| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef BASE_TRACE_EVENT_TRACE_BUFFER_H_ | 5 #ifndef BASE_TRACE_EVENT_TRACE_BUFFER_H_ |
| 6 #define BASE_TRACE_EVENT_TRACE_BUFFER_H_ | 6 #define BASE_TRACE_EVENT_TRACE_BUFFER_H_ |
| 7 | 7 |
| 8 #include "base/base_export.h" | 8 #include "base/base_export.h" |
| 9 #include "base/trace_event/trace_event.h" | 9 #include "base/trace_event/trace_event.h" |
| 10 #include "base/trace_event/trace_event_impl.h" | 10 #include "base/trace_event/trace_event_impl.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 } | 37 } |
| 38 | 38 |
| 39 scoped_ptr<TraceBufferChunk> Clone() const; | 39 scoped_ptr<TraceBufferChunk> Clone() const; |
| 40 | 40 |
| 41 void EstimateTraceMemoryOverhead(TraceEventMemoryOverhead* overhead); | 41 void EstimateTraceMemoryOverhead(TraceEventMemoryOverhead* overhead); |
| 42 | 42 |
| 43 static const size_t kTraceBufferChunkSize = 64; | 43 static const size_t kTraceBufferChunkSize = 64; |
| 44 | 44 |
| 45 private: | 45 private: |
| 46 size_t next_free_; | 46 size_t next_free_; |
| 47 scoped_ptr<TraceEventMemoryOverhead> cached_overhead_estimate_when_full_; | 47 scoped_ptr<TraceEventMemoryOverhead> cached_overhead_estimate_; |
| 48 TraceEvent chunk_[kTraceBufferChunkSize]; | 48 TraceEvent chunk_[kTraceBufferChunkSize]; |
| 49 uint32 seq_; | 49 uint32 seq_; |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 // TraceBuffer holds the events as they are collected. | 52 // TraceBuffer holds the events as they are collected. |
| 53 class BASE_EXPORT TraceBuffer { | 53 class BASE_EXPORT TraceBuffer { |
| 54 public: | 54 public: |
| 55 virtual ~TraceBuffer() {} | 55 virtual ~TraceBuffer() {} |
| 56 | 56 |
| 57 virtual scoped_ptr<TraceBufferChunk> GetChunk(size_t* index) = 0; | 57 virtual scoped_ptr<TraceBufferChunk> GetChunk(size_t* index) = 0; |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 | 117 |
| 118 private: | 118 private: |
| 119 OutputCallback output_callback_; | 119 OutputCallback output_callback_; |
| 120 bool append_comma_; | 120 bool append_comma_; |
| 121 }; | 121 }; |
| 122 | 122 |
| 123 } // namespace trace_event | 123 } // namespace trace_event |
| 124 } // namespace base | 124 } // namespace base |
| 125 | 125 |
| 126 #endif // BASE_TRACE_EVENT_TRACE_BUFFER_H_ | 126 #endif // BASE_TRACE_EVENT_TRACE_BUFFER_H_ |
| OLD | NEW |