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

Unified Diff: base/debug/trace_event_impl.cc

Issue 492823002: Add OnBeforeTraceLogDisabled notification to EnabledStateObserver (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rename the callback to OnBeforeTraceLogDisabled Created 6 years, 4 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_impl.h ('k') | base/debug/trace_event_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/debug/trace_event_impl.cc
diff --git a/base/debug/trace_event_impl.cc b/base/debug/trace_event_impl.cc
index 5c521d462fe0e73c766d801f1b4340ad2d82670f..5341ba3a1867861cb444cd0009fa6dfea0d49f64 100644
--- a/base/debug/trace_event_impl.cc
+++ b/base/debug/trace_event_impl.cc
@@ -1533,6 +1533,19 @@ void TraceLog::SetDisabledWhileLocked() {
return;
}
+ dispatching_to_observer_list_ = true;
+ std::vector<EnabledStateObserver*> observer_list =
+ enabled_state_observer_list_;
+
+ {
+ // Dispatch to observers outside the lock in case the observer triggers a
+ // trace event.
+ AutoUnlock unlock(lock_);
+ for (size_t i = 0; i < observer_list.size(); ++i)
+ observer_list[i]->OnBeforeTraceLogDisabled();
+ }
+ dispatching_to_observer_list_ = false;
+
mode_ = DISABLED;
if (sampling_thread_.get()) {
@@ -1552,9 +1565,6 @@ void TraceLog::SetDisabledWhileLocked() {
AddMetadataEventsWhileLocked();
dispatching_to_observer_list_ = true;
- std::vector<EnabledStateObserver*> observer_list =
- enabled_state_observer_list_;
-
{
// Dispatch to observers outside the lock in case the observer triggers a
// trace event.
« no previous file with comments | « base/debug/trace_event_impl.h ('k') | base/debug/trace_event_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698