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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 TRACE_EVENT_PHASE_INSTANT, \ | 42 TRACE_EVENT_PHASE_INSTANT, \ |
43 name, reinterpret_cast<const void*>(id), extra) | 43 name, reinterpret_cast<const void*>(id), extra) |
44 | 44 |
45 template <typename Type> | 45 template <typename Type> |
46 struct DefaultSingletonTraits; | 46 struct DefaultSingletonTraits; |
47 | 47 |
48 namespace base { | 48 namespace base { |
49 | 49 |
50 class WaitableEvent; | 50 class WaitableEvent; |
51 class MessageLoop; | 51 class MessageLoop; |
| 52 class SequencedTaskRunner; |
52 | 53 |
53 namespace debug { | 54 namespace debug { |
54 | 55 |
55 // For any argument of type TRACE_VALUE_TYPE_CONVERTABLE the provided | 56 // For any argument of type TRACE_VALUE_TYPE_CONVERTABLE the provided |
56 // class must implement this interface. | 57 // class must implement this interface. |
57 class BASE_EXPORT ConvertableToTraceFormat | 58 class BASE_EXPORT ConvertableToTraceFormat |
58 : public RefCounted<ConvertableToTraceFormat> { | 59 : public RefCounted<ConvertableToTraceFormat> { |
59 public: | 60 public: |
60 // Append the class info to the provided |out| string. The appended | 61 // Append the class info to the provided |out| string. The appended |
61 // data must be a valid JSON object. Strings must be properly quoted, and | 62 // data must be a valid JSON object. Strings must be properly quoted, and |
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
780 PlatformThreadHandle sampling_thread_handle_; | 781 PlatformThreadHandle sampling_thread_handle_; |
781 | 782 |
782 CategoryFilter category_filter_; | 783 CategoryFilter category_filter_; |
783 CategoryFilter event_callback_category_filter_; | 784 CategoryFilter event_callback_category_filter_; |
784 | 785 |
785 ThreadLocalPointer<ThreadLocalEventBuffer> thread_local_event_buffer_; | 786 ThreadLocalPointer<ThreadLocalEventBuffer> thread_local_event_buffer_; |
786 ThreadLocalBoolean thread_blocks_message_loop_; | 787 ThreadLocalBoolean thread_blocks_message_loop_; |
787 ThreadLocalBoolean thread_is_in_trace_event_; | 788 ThreadLocalBoolean thread_is_in_trace_event_; |
788 | 789 |
789 // Contains the message loops of threads that have had at least one event | 790 // Contains the message loops of threads that have had at least one event |
790 // added into the local event buffer. Not using MessageLoopProxy because we | 791 // added into the local event buffer. Not using TaskRunners because we |
791 // need to know the life time of the message loops. | 792 // need to know the life time of the message loops. |
792 hash_set<MessageLoop*> thread_message_loops_; | 793 hash_set<MessageLoop*> thread_message_loops_; |
793 | 794 |
794 // For events which can't be added into the thread local buffer, e.g. events | 795 // For events which can't be added into the thread local buffer, e.g. events |
795 // from threads without a message loop. | 796 // from threads without a message loop. |
796 scoped_ptr<TraceBufferChunk> thread_shared_chunk_; | 797 scoped_ptr<TraceBufferChunk> thread_shared_chunk_; |
797 size_t thread_shared_chunk_index_; | 798 size_t thread_shared_chunk_index_; |
798 | 799 |
799 // Set when asynchronous Flush is in progress. | 800 // Set when asynchronous Flush is in progress. |
800 OutputCallback flush_output_callback_; | 801 OutputCallback flush_output_callback_; |
801 scoped_refptr<MessageLoopProxy> flush_message_loop_proxy_; | 802 scoped_refptr<SequencedTaskRunner> flush_task_runner_; |
802 subtle::AtomicWord generation_; | 803 subtle::AtomicWord generation_; |
803 | 804 |
804 DISALLOW_COPY_AND_ASSIGN(TraceLog); | 805 DISALLOW_COPY_AND_ASSIGN(TraceLog); |
805 }; | 806 }; |
806 | 807 |
807 } // namespace debug | 808 } // namespace debug |
808 } // namespace base | 809 } // namespace base |
809 | 810 |
810 #endif // BASE_DEBUG_TRACE_EVENT_IMPL_H_ | 811 #endif // BASE_DEBUG_TRACE_EVENT_IMPL_H_ |
OLD | NEW |