| 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 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 703 bool check_buffer_is_full); | 703 bool check_buffer_is_full); |
| 704 void CheckIfBufferIsFullWhileLocked(); | 704 void CheckIfBufferIsFullWhileLocked(); |
| 705 void SetDisabledWhileLocked(); | 705 void SetDisabledWhileLocked(); |
| 706 | 706 |
| 707 TraceEvent* GetEventByHandleInternal(TraceEventHandle handle, | 707 TraceEvent* GetEventByHandleInternal(TraceEventHandle handle, |
| 708 OptionalAutoLock* lock); | 708 OptionalAutoLock* lock); |
| 709 | 709 |
| 710 // |generation| is used in the following callbacks to check if the callback | 710 // |generation| is used in the following callbacks to check if the callback |
| 711 // is called for the flush of the current |logged_events_|. | 711 // is called for the flush of the current |logged_events_|. |
| 712 void FlushCurrentThread(int generation); | 712 void FlushCurrentThread(int generation); |
| 713 void ConvertTraceEventsToTraceFormat(scoped_ptr<TraceBuffer> logged_events, | 713 // Usually it runs on a different thread. |
| 714 static void ConvertTraceEventsToTraceFormat( |
| 715 scoped_ptr<TraceBuffer> logged_events, |
| 714 const TraceLog::OutputCallback& flush_output_callback); | 716 const TraceLog::OutputCallback& flush_output_callback); |
| 715 void FinishFlush(int generation); | 717 void FinishFlush(int generation); |
| 716 void OnFlushTimeout(int generation); | 718 void OnFlushTimeout(int generation); |
| 717 | 719 |
| 718 int generation() const { | 720 int generation() const { |
| 719 return static_cast<int>(subtle::NoBarrier_Load(&generation_)); | 721 return static_cast<int>(subtle::NoBarrier_Load(&generation_)); |
| 720 } | 722 } |
| 721 bool CheckGeneration(int generation) const { | 723 bool CheckGeneration(int generation) const { |
| 722 return generation == this->generation(); | 724 return generation == this->generation(); |
| 723 } | 725 } |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 805 scoped_refptr<MessageLoopProxy> flush_message_loop_proxy_; | 807 scoped_refptr<MessageLoopProxy> flush_message_loop_proxy_; |
| 806 subtle::AtomicWord generation_; | 808 subtle::AtomicWord generation_; |
| 807 | 809 |
| 808 DISALLOW_COPY_AND_ASSIGN(TraceLog); | 810 DISALLOW_COPY_AND_ASSIGN(TraceLog); |
| 809 }; | 811 }; |
| 810 | 812 |
| 811 } // namespace debug | 813 } // namespace debug |
| 812 } // namespace base | 814 } // namespace base |
| 813 | 815 |
| 814 #endif // BASE_DEBUG_TRACE_EVENT_IMPL_H_ | 816 #endif // BASE_DEBUG_TRACE_EVENT_IMPL_H_ |
| OLD | NEW |