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

Unified Diff: base/debug/trace_event_impl.h

Issue 15774010: Add TRACE_EVENT_IS_NEW_TRACE as a way to snapshot objects at start of recording (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: parts for enne Created 7 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: base/debug/trace_event_impl.h
diff --git a/base/debug/trace_event_impl.h b/base/debug/trace_event_impl.h
index e6bca4b324f7f2d8aa027d996047fb6fcfa9b1a3..3acff51d4cedef34043570645840390eb07788d1 100644
--- a/base/debug/trace_event_impl.h
+++ b/base/debug/trace_event_impl.h
@@ -317,6 +317,13 @@ class BASE_EXPORT TraceLog {
void SetDisabled();
bool IsEnabled() { return !!enable_count_; }
+ // The number of times we have begun recording traces. If tracing is off,
+ // returns -1. If tracing is on, then it returns the number of times we have
+ // recorded a trace. By watching for this number to increment, you can
+ // passively discover when a new trace has begun. This is then used to
+ // implement the TRACE_EVENT_IS_NEW_TRACE() primitive.
+ int GetNumTracesRecorded();
+
#if defined(OS_ANDROID)
void StartATrace();
void StopATrace();
@@ -524,6 +531,7 @@ class BASE_EXPORT TraceLog {
// This lock protects TraceLog member accesses from arbitrary threads.
Lock lock_;
int enable_count_;
+ int num_traces_recorded_;
NotificationCallback notification_callback_;
scoped_ptr<TraceBuffer> logged_events_;
EventCallback event_callback_;

Powered by Google App Engine
This is Rietveld 408576698