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

Unified Diff: base/debug/trace_event_impl.h

Issue 11802005: Enable overlapping, usage counted SetEnabled()/SetDisabled() for TraceLog (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed fatal warning on win Created 7 years, 11 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 | « no previous file | 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 87cfa8cdfa2ead264fb8ac37c5d5e782660f51f5..fb9c5791021ed3b26ef34142f74264a45dc024a4 100644
--- a/base/debug/trace_event_impl.h
+++ b/base/debug/trace_event_impl.h
@@ -206,7 +206,7 @@ class BASE_EXPORT TraceLog {
void SetDisabled();
// Helper method to enable/disable tracing for all categories.
void SetEnabled(bool enabled);
- bool IsEnabled() { return enabled_; }
+ bool IsEnabled() { return !!enable_count_; }
#if defined(OS_ANDROID)
static void InitATrace();
@@ -367,7 +367,7 @@ class BASE_EXPORT TraceLog {
// synchronization.
// This lock protects TraceLog member accesses from arbitrary threads.
Lock lock_;
- bool enabled_;
+ int enable_count_;
NotificationCallback notification_callback_;
std::vector<TraceEvent> logged_events_;
std::vector<std::string> included_categories_;
« no previous file with comments | « no previous file | base/debug/trace_event_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698