diff options
author | mithro@mithis.com <mithro@mithis.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-10 02:16:02 +0000 |
---|---|---|
committer | mithro@mithis.com <mithro@mithis.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-10 02:16:02 +0000 |
commit | fc441c6d790e1b8e7bf890cebe6c7577317a158c (patch) | |
tree | a1749683debd74a55c42b92f8685db43ef9407b7 /cc/debug | |
parent | 9d70de1a6c9c22c1ea9baa2ea02233dcc0cf5479 (diff) | |
download | chromium_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')
-rw-r--r-- | cc/debug/traced_value.h | 11 |
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_ |