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

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: rebase 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
« no previous file with comments | « base/debug/trace_event.h ('k') | base/debug/trace_event_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/debug/trace_event_impl.h
diff --git a/base/debug/trace_event_impl.h b/base/debug/trace_event_impl.h
index da70b4bc54d1bfd54526491aea23e9c115b1e624..b3be02a4a422f0e6a9797c00ef3166f4c161ecce 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();
@@ -526,6 +533,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_;
« no previous file with comments | « base/debug/trace_event.h ('k') | base/debug/trace_event_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698