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

Unified Diff: third_party/WebKit/Source/platform/TraceEvent.h

Issue 1447563002: Implement frame attribution (FrameBlamer) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: It builds => ship it. Created 4 years, 10 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: third_party/WebKit/Source/platform/TraceEvent.h
diff --git a/third_party/WebKit/Source/platform/TraceEvent.h b/third_party/WebKit/Source/platform/TraceEvent.h
index b2d51c05913d706cfeadaa873c662fbde7eee251..4770247b878a9181efea0ed8ef8dd8ace3c1825c 100644
--- a/third_party/WebKit/Source/platform/TraceEvent.h
+++ b/third_party/WebKit/Source/platform/TraceEvent.h
@@ -291,11 +291,12 @@ const unsigned long long noBindId = 0;
// with the Process ID so that they are unlikely to collide when the same
// pointer is used on different processes.
class TraceID final {
- STACK_ALLOCATED();
+ DISALLOW_NEW();
WTF_MAKE_NONCOPYABLE(TraceID);
public:
class WithScope final {
- STACK_ALLOCATED();
+ DISALLOW_NEW();
+
public:
template<typename T> WithScope(const char* scope, T id)
: m_scope(scope), m_data(reinterpret_cast<unsigned long long>(id)) { }
@@ -307,7 +308,8 @@ public:
};
template<bool dummyMangle> class MangleBehavior final {
- STACK_ALLOCATED();
+ DISALLOW_NEW();
+
public:
template<typename T> explicit MangleBehavior(T id) : m_data(reinterpret_cast<unsigned long long>(id)) { }
explicit MangleBehavior(WithScope scopedID) : m_scope(scopedID.scope()), m_data(scopedID.data()) { }
@@ -369,7 +371,8 @@ union TraceValueUnion {
// Simple container for const char* that should be copied instead of retained.
class TraceStringWithCopy {
- STACK_ALLOCATED();
+ DISALLOW_NEW();
+
public:
explicit TraceStringWithCopy(const char* str) : m_str(str) { }
const char* str() const { return m_str; }
@@ -594,7 +597,7 @@ static inline TraceEventHandle addTraceEvent(
// Used by TRACE_EVENTx macro. Do not use directly.
class ScopedTracer final {
- STACK_ALLOCATED();
+ DISALLOW_NEW();
WTF_MAKE_NONCOPYABLE(ScopedTracer);
public:
// Note: members of m_data intentionally left uninitialized. See initialize.
@@ -634,7 +637,7 @@ private:
// the sampling state having recorded.
template<size_t BucketNumber>
class SamplingStateScope final {
- STACK_ALLOCATED();
+ DISALLOW_NEW();
WTF_MAKE_NONCOPYABLE(SamplingStateScope);
public:
SamplingStateScope(const char* categoryAndName)
@@ -663,7 +666,7 @@ private:
};
template<typename IDType> class TraceScopedTrackableObject {
- STACK_ALLOCATED();
+ DISALLOW_NEW();
WTF_MAKE_NONCOPYABLE(TraceScopedTrackableObject);
public:
TraceScopedTrackableObject(const char* categoryGroup, const char* name, IDType id)
@@ -672,6 +675,12 @@ public:
TRACE_EVENT_OBJECT_CREATED_WITH_ID(m_categoryGroup, m_name, m_id);
}
+ template <typename ArgType>
+ void snapshot(ArgType snapshot) const
+ {
+ TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(m_categoryGroup, m_name, m_id, snapshot);
+ }
+
~TraceScopedTrackableObject()
{
TRACE_EVENT_OBJECT_DELETED_WITH_ID(m_categoryGroup, m_name, m_id);

Powered by Google App Engine
This is Rietveld 408576698