| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 | 5 |
| 6 #ifndef BASE_DEBUG_TRACE_EVENT_IMPL_H_ | 6 #ifndef BASE_DEBUG_TRACE_EVENT_IMPL_H_ |
| 7 #define BASE_DEBUG_TRACE_EVENT_IMPL_H_ | 7 #define BASE_DEBUG_TRACE_EVENT_IMPL_H_ |
| 8 | 8 |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 | 10 |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 // Called just before the tracing system becomes | 220 // Called just before the tracing system becomes |
| 221 // enabled. TraceLog::IsEnabled will return false at this point and trace | 221 // enabled. TraceLog::IsEnabled will return false at this point and trace |
| 222 // macros and methods called within the observer will deadlock. | 222 // macros and methods called within the observer will deadlock. |
| 223 virtual void OnTraceLogWillEnable() { } | 223 virtual void OnTraceLogWillEnable() { } |
| 224 | 224 |
| 225 // Called just before the tracing system disables. TraceLog::IsEnabled is | 225 // Called just before the tracing system disables. TraceLog::IsEnabled is |
| 226 // still false at this point TRACE macros will still be capturing | 226 // still false at this point TRACE macros will still be capturing |
| 227 // data. However, trace macros and methods called within the observer will | 227 // data. However, trace macros and methods called within the observer will |
| 228 // deadlock. | 228 // deadlock. |
| 229 virtual void OnTraceLogWillDisable() { } | 229 virtual void OnTraceLogWillDisable() { } |
| 230 |
| 231 protected: |
| 232 virtual ~EnabledStateChangedObserver() { } |
| 230 }; | 233 }; |
| 231 void AddEnabledStateObserver(EnabledStateChangedObserver* listener); | 234 void AddEnabledStateObserver(EnabledStateChangedObserver* listener); |
| 232 void RemoveEnabledStateObserver(EnabledStateChangedObserver* listener); | 235 void RemoveEnabledStateObserver(EnabledStateChangedObserver* listener); |
| 233 | 236 |
| 234 float GetBufferPercentFull() const; | 237 float GetBufferPercentFull() const; |
| 235 | 238 |
| 236 // Set the thread-safe notification callback. The callback can occur at any | 239 // Set the thread-safe notification callback. The callback can occur at any |
| 237 // time and from any thread. WARNING: It is possible for the previously set | 240 // time and from any thread. WARNING: It is possible for the previously set |
| 238 // callback to be called during OR AFTER a call to SetNotificationCallback. | 241 // callback to be called during OR AFTER a call to SetNotificationCallback. |
| 239 // Therefore, the target of the callback must either be a global function, | 242 // Therefore, the target of the callback must either be a global function, |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 const unsigned char* watch_category_; | 390 const unsigned char* watch_category_; |
| 388 std::string watch_event_name_; | 391 std::string watch_event_name_; |
| 389 | 392 |
| 390 DISALLOW_COPY_AND_ASSIGN(TraceLog); | 393 DISALLOW_COPY_AND_ASSIGN(TraceLog); |
| 391 }; | 394 }; |
| 392 | 395 |
| 393 } // namespace debug | 396 } // namespace debug |
| 394 } // namespace base | 397 } // namespace base |
| 395 | 398 |
| 396 #endif // BASE_DEBUG_TRACE_EVENT_IMPL_H_ | 399 #endif // BASE_DEBUG_TRACE_EVENT_IMPL_H_ |
| OLD | NEW |