Add builders for tracing event's structural arguments

The new classes allow building JSON-like structural arguments. Current implementation uses base::Value as backing store but that can be replaced in the future with something more efficient without changing client code.

All clients of cc/debug/traced_value.h should eventually switch to use the new builders.

BUG=361045

Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=286849

[email protected], [email protected], [email protected], [email protected]

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@286984 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/cc/trees/layer_tree_host_impl.h b/cc/trees/layer_tree_host_impl.h
index 7b3c3fd..821028fa 100644
--- a/cc/trees/layer_tree_host_impl.h
+++ b/cc/trees/layer_tree_host_impl.h
@@ -165,7 +165,7 @@
   struct CC_EXPORT FrameData : public RenderPassSink {
     FrameData();
     virtual ~FrameData();
-    scoped_ptr<base::Value> AsValue() const;
+    void AsValueInto(base::debug::TracedValue* value) const;
 
     std::vector<gfx::Rect> occluding_screen_space_rects;
     std::vector<gfx::Rect> non_occluding_screen_space_rects;
@@ -434,9 +434,17 @@
     return begin_impl_frame_interval_;
   }
 
-  scoped_ptr<base::Value> AsValue() const { return AsValueWithFrame(NULL); }
-  scoped_ptr<base::Value> AsValueWithFrame(FrameData* frame) const;
-  scoped_ptr<base::Value> ActivationStateAsValue() const;
+  void AsValueInto(base::debug::TracedValue* value) const {
+    return AsValueWithFrameInto(NULL, value);
+  }
+  void AsValueWithFrameInto(FrameData* frame,
+                            base::debug::TracedValue* value) const;
+  scoped_refptr<base::debug::ConvertableToTraceFormat> AsValue() const;
+  scoped_refptr<base::debug::ConvertableToTraceFormat> AsValueWithFrame(
+      FrameData* frame) const;
+  scoped_refptr<base::debug::ConvertableToTraceFormat> ActivationStateAsValue()
+      const;
+  void ActivationStateAsValueInto(base::debug::TracedValue* value) const;
 
   bool page_scale_animation_active() const { return !!page_scale_animation_; }