summaryrefslogtreecommitdiffstats
path: root/cc/debug/traced_value.h
diff options
context:
space:
mode:
authormithro@mithis.com <mithro@mithis.com@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-10 02:16:02 +0000
committermithro@mithis.com <mithro@mithis.com@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-10 02:16:02 +0000
commitfc441c6d790e1b8e7bf890cebe6c7577317a158c (patch)
treea1749683debd74a55c42b92f8685db43ef9407b7 /cc/debug/traced_value.h
parent9d70de1a6c9c22c1ea9baa2ea02233dcc0cf5479 (diff)
downloadchromium_src-fc441c6d790e1b8e7bf890cebe6c7577317a158c.zip
chromium_src-fc441c6d790e1b8e7bf890cebe6c7577317a158c.tar.gz
chromium_src-fc441c6d790e1b8e7bf890cebe6c7577317a158c.tar.bz2
Making BeginFrameArgs work with TRACE_EVENT system.
* Added ToValue() method on BeginFrameArgs. * Added a ToTrace method inside cc/traced_value.h for easy conversion, just do a ToTrace(XXX) of anything which has a ToValue() method. * Rename Scheduler::StateAsValue to AsValue so it works with above. BUG=371223 Review URL: https://codereview.chromium.org/270703004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@269487 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/debug/traced_value.h')
-rw-r--r--cc/debug/traced_value.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/cc/debug/traced_value.h b/cc/debug/traced_value.h
index e96c09a..560eaf8 100644
--- a/cc/debug/traced_value.h
+++ b/cc/debug/traced_value.h
@@ -46,6 +46,17 @@ class TracedValue : public base::debug::ConvertableToTraceFormat {
DISALLOW_COPY_AND_ASSIGN(TracedValue);
};
+template <class T>
+static scoped_refptr<base::debug::ConvertableToTraceFormat> ToTrace(T* t) {
+ return TracedValue::FromValue(t->AsValue().release());
+}
+
+template <class T>
+static scoped_refptr<base::debug::ConvertableToTraceFormat> ToTrace(
+ const T& t) {
+ return ToTrace(&t);
+}
+
} // namespace cc
#endif // CC_DEBUG_TRACED_VALUE_H_