Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(165)

Unified Diff: cc/output/begin_frame_args.cc

Issue 270703004: Making BeginFrameArgs work with TRACE_EVENT system. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Using AsValue rather than StateAsValue. Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: cc/output/begin_frame_args.cc
diff --git a/cc/output/begin_frame_args.cc b/cc/output/begin_frame_args.cc
index 92901afb1f3d897b37ca374297a8e5bc25463cbc..d21dc0b79d8de35f26f4144523573f9a1fe05d5e 100644
--- a/cc/output/begin_frame_args.cc
+++ b/cc/output/begin_frame_args.cc
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/json/json_writer.h"
#include "cc/output/begin_frame_args.h"
#include "ui/gfx/frame_time.h"
@@ -27,6 +28,15 @@ BeginFrameArgs BeginFrameArgs::Create(base::TimeTicks frame_time,
return BeginFrameArgs(frame_time, deadline, interval);
}
+scoped_ptr<base::Value> BeginFrameArgs::AsValue() const {
+ scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue);
+ state->SetString("type", "BeginFrameArgs");
+ state->SetDouble("frame_time_us", frame_time.ToInternalValue());
+ state->SetDouble("deadline_us", deadline.ToInternalValue());
+ state->SetDouble("interval_us", interval.InMicroseconds());
+ return state.PassAs<base::Value>();
+}
+
BeginFrameArgs BeginFrameArgs::CreateForSynchronousCompositor() {
// For WebView/SynchronousCompositor, we always want to draw immediately,
// so we set the deadline to 0 and guess that the interval is 16 milliseconds.

Powered by Google App Engine
This is Rietveld 408576698