| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 return reinterpret_cast<std::size_t>(value); | 52 return reinterpret_cast<std::size_t>(value); |
| 53 } | 53 } |
| 54 }; | 54 }; |
| 55 } // BASE_HASH_NAMESPACE | 55 } // BASE_HASH_NAMESPACE |
| 56 #endif | 56 #endif |
| 57 | 57 |
| 58 namespace base { | 58 namespace base { |
| 59 | 59 |
| 60 class WaitableEvent; | 60 class WaitableEvent; |
| 61 class MessageLoop; | 61 class MessageLoop; |
| 62 class SequencedTaskRunner; |
| 62 | 63 |
| 63 namespace debug { | 64 namespace debug { |
| 64 | 65 |
| 65 // For any argument of type TRACE_VALUE_TYPE_CONVERTABLE the provided | 66 // For any argument of type TRACE_VALUE_TYPE_CONVERTABLE the provided |
| 66 // class must implement this interface. | 67 // class must implement this interface. |
| 67 class ConvertableToTraceFormat : public RefCounted<ConvertableToTraceFormat> { | 68 class ConvertableToTraceFormat : public RefCounted<ConvertableToTraceFormat> { |
| 68 public: | 69 public: |
| 69 // Append the class info to the provided |out| string. The appended | 70 // Append the class info to the provided |out| string. The appended |
| 70 // data must be a valid JSON object. Strings must be properly quoted, and | 71 // data must be a valid JSON object. Strings must be properly quoted, and |
| 71 // escaped. There is no processing applied to the content after it is | 72 // escaped. There is no processing applied to the content after it is |
| (...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 711 PlatformThreadHandle sampling_thread_handle_; | 712 PlatformThreadHandle sampling_thread_handle_; |
| 712 | 713 |
| 713 CategoryFilter category_filter_; | 714 CategoryFilter category_filter_; |
| 714 CategoryFilter event_callback_category_filter_; | 715 CategoryFilter event_callback_category_filter_; |
| 715 | 716 |
| 716 ThreadLocalPointer<ThreadLocalEventBuffer> thread_local_event_buffer_; | 717 ThreadLocalPointer<ThreadLocalEventBuffer> thread_local_event_buffer_; |
| 717 ThreadLocalBoolean thread_blocks_message_loop_; | 718 ThreadLocalBoolean thread_blocks_message_loop_; |
| 718 ThreadLocalBoolean thread_is_in_trace_event_; | 719 ThreadLocalBoolean thread_is_in_trace_event_; |
| 719 | 720 |
| 720 // Contains the message loops of threads that have had at least one event | 721 // Contains the message loops of threads that have had at least one event |
| 721 // added into the local event buffer. Not using MessageLoopProxy because we | 722 // added into the local event buffer. Not using TaskRunners because we |
| 722 // need to know the life time of the message loops. | 723 // need to know the life time of the message loops. |
| 723 hash_set<MessageLoop*> thread_message_loops_; | 724 hash_set<MessageLoop*> thread_message_loops_; |
| 724 | 725 |
| 725 // For events which can't be added into the thread local buffer, e.g. events | 726 // For events which can't be added into the thread local buffer, e.g. events |
| 726 // from threads without a message loop. | 727 // from threads without a message loop. |
| 727 scoped_ptr<TraceBufferChunk> thread_shared_chunk_; | 728 scoped_ptr<TraceBufferChunk> thread_shared_chunk_; |
| 728 size_t thread_shared_chunk_index_; | 729 size_t thread_shared_chunk_index_; |
| 729 | 730 |
| 730 // Set when asynchronous Flush is in progress. | 731 // Set when asynchronous Flush is in progress. |
| 731 OutputCallback flush_output_callback_; | 732 OutputCallback flush_output_callback_; |
| 732 scoped_refptr<MessageLoopProxy> flush_message_loop_proxy_; | 733 scoped_refptr<SequencedTaskRunner> flush_task_runner_; |
| 733 subtle::AtomicWord generation_; | 734 subtle::AtomicWord generation_; |
| 734 | 735 |
| 735 DISALLOW_COPY_AND_ASSIGN(TraceLog); | 736 DISALLOW_COPY_AND_ASSIGN(TraceLog); |
| 736 }; | 737 }; |
| 737 | 738 |
| 738 } // namespace debug | 739 } // namespace debug |
| 739 } // namespace base | 740 } // namespace base |
| 740 | 741 |
| 741 #endif // BASE_DEBUG_TRACE_EVENT_IMPL_H_ | 742 #endif // BASE_DEBUG_TRACE_EVENT_IMPL_H_ |
| OLD | NEW |