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 <stack> | 9 #include <stack> |
10 #include <string> | 10 #include <string> |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 // Called just after the tracing system becomes enabled, outside of the | 337 // Called just after the tracing system becomes enabled, outside of the |
338 // |lock_|. TraceLog::IsEnabled() is true at this point. | 338 // |lock_|. TraceLog::IsEnabled() is true at this point. |
339 virtual void OnTraceLogEnabled() = 0; | 339 virtual void OnTraceLogEnabled() = 0; |
340 | 340 |
341 // Called just after the tracing system disables, outside of the |lock_|. | 341 // Called just after the tracing system disables, outside of the |lock_|. |
342 // TraceLog::IsEnabled() is false at this point. | 342 // TraceLog::IsEnabled() is false at this point. |
343 virtual void OnTraceLogDisabled() = 0; | 343 virtual void OnTraceLogDisabled() = 0; |
344 }; | 344 }; |
345 void AddEnabledStateObserver(EnabledStateObserver* listener); | 345 void AddEnabledStateObserver(EnabledStateObserver* listener); |
346 void RemoveEnabledStateObserver(EnabledStateObserver* listener); | 346 void RemoveEnabledStateObserver(EnabledStateObserver* listener); |
| 347 bool HasEnabledStateObserver(EnabledStateObserver* listener) const; |
347 | 348 |
348 float GetBufferPercentFull() const; | 349 float GetBufferPercentFull() const; |
349 | 350 |
350 // Set the thread-safe notification callback. The callback can occur at any | 351 // Set the thread-safe notification callback. The callback can occur at any |
351 // time and from any thread. WARNING: It is possible for the previously set | 352 // time and from any thread. WARNING: It is possible for the previously set |
352 // callback to be called during OR AFTER a call to SetNotificationCallback. | 353 // callback to be called during OR AFTER a call to SetNotificationCallback. |
353 // Therefore, the target of the callback must either be a global function, | 354 // Therefore, the target of the callback must either be a global function, |
354 // ref-counted object or a LazyInstance with Leaky traits (or equivalent). | 355 // ref-counted object or a LazyInstance with Leaky traits (or equivalent). |
355 typedef base::Callback<void(int)> NotificationCallback; | 356 typedef base::Callback<void(int)> NotificationCallback; |
356 void SetNotificationCallback(const NotificationCallback& cb); | 357 void SetNotificationCallback(const NotificationCallback& cb); |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
582 | 583 |
583 CategoryFilter category_filter_; | 584 CategoryFilter category_filter_; |
584 | 585 |
585 DISALLOW_COPY_AND_ASSIGN(TraceLog); | 586 DISALLOW_COPY_AND_ASSIGN(TraceLog); |
586 }; | 587 }; |
587 | 588 |
588 } // namespace debug | 589 } // namespace debug |
589 } // namespace base | 590 } // namespace base |
590 | 591 |
591 #endif // BASE_DEBUG_TRACE_EVENT_IMPL_H_ | 592 #endif // BASE_DEBUG_TRACE_EVENT_IMPL_H_ |
OLD | NEW |