| 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> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/atomicops.h" | 13 #include "base/atomicops.h" |
| 14 #include "base/base_export.h" |
| 14 #include "base/callback.h" | 15 #include "base/callback.h" |
| 15 #include "base/containers/hash_tables.h" | 16 #include "base/containers/hash_tables.h" |
| 16 #include "base/gtest_prod_util.h" | 17 #include "base/gtest_prod_util.h" |
| 17 #include "base/memory/ref_counted_memory.h" | 18 #include "base/memory/ref_counted_memory.h" |
| 18 #include "base/memory/scoped_vector.h" | 19 #include "base/memory/scoped_vector.h" |
| 19 #include "base/observer_list.h" | 20 #include "base/observer_list.h" |
| 20 #include "base/strings/string_util.h" | 21 #include "base/strings/string_util.h" |
| 21 #include "base/synchronization/condition_variable.h" | 22 #include "base/synchronization/condition_variable.h" |
| 22 #include "base/synchronization/lock.h" | 23 #include "base/synchronization/lock.h" |
| 23 #include "base/threading/thread.h" | 24 #include "base/threading/thread.h" |
| (...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 486 | 487 |
| 487 #if defined(OS_ANDROID) | 488 #if defined(OS_ANDROID) |
| 488 void StartATrace(); | 489 void StartATrace(); |
| 489 void StopATrace(); | 490 void StopATrace(); |
| 490 void AddClockSyncMetadataEvent(); | 491 void AddClockSyncMetadataEvent(); |
| 491 #endif | 492 #endif |
| 492 | 493 |
| 493 // Enabled state listeners give a callback when tracing is enabled or | 494 // Enabled state listeners give a callback when tracing is enabled or |
| 494 // disabled. This can be used to tie into other library's tracing systems | 495 // disabled. This can be used to tie into other library's tracing systems |
| 495 // on-demand. | 496 // on-demand. |
| 496 class EnabledStateObserver { | 497 class BASE_EXPORT EnabledStateObserver { |
| 497 public: | 498 public: |
| 498 // Called just after the tracing system becomes enabled, outside of the | 499 // Called just after the tracing system becomes enabled, outside of the |
| 499 // |lock_|. TraceLog::IsEnabled() is true at this point. | 500 // |lock_|. TraceLog::IsEnabled() is true at this point. |
| 500 virtual void OnTraceLogEnabled() = 0; | 501 virtual void OnTraceLogEnabled() = 0; |
| 501 | 502 |
| 502 // Called just after the tracing system disables, outside of the |lock_|. | 503 // Called just after the tracing system disables, outside of the |lock_|. |
| 503 // TraceLog::IsEnabled() is false at this point. | 504 // TraceLog::IsEnabled() is false at this point. |
| 504 virtual void OnTraceLogDisabled() = 0; | 505 virtual void OnTraceLogDisabled() = 0; |
| 505 }; | 506 }; |
| 506 void AddEnabledStateObserver(EnabledStateObserver* listener); | 507 void AddEnabledStateObserver(EnabledStateObserver* listener); |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 811 scoped_refptr<MessageLoopProxy> flush_message_loop_proxy_; | 812 scoped_refptr<MessageLoopProxy> flush_message_loop_proxy_; |
| 812 subtle::AtomicWord generation_; | 813 subtle::AtomicWord generation_; |
| 813 | 814 |
| 814 DISALLOW_COPY_AND_ASSIGN(TraceLog); | 815 DISALLOW_COPY_AND_ASSIGN(TraceLog); |
| 815 }; | 816 }; |
| 816 | 817 |
| 817 } // namespace debug | 818 } // namespace debug |
| 818 } // namespace base | 819 } // namespace base |
| 819 | 820 |
| 820 #endif // BASE_DEBUG_TRACE_EVENT_IMPL_H_ | 821 #endif // BASE_DEBUG_TRACE_EVENT_IMPL_H_ |
| OLD | NEW |