| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef BASE_TRACE_EVENT_THREAD_LOCAL_EVENT_BUFFER_H_ |
| 6 #define BASE_TRACE_EVENT_THREAD_LOCAL_EVENT_BUFFER_H_ |
| 7 |
| 8 #include <memory> |
| 9 |
| 10 #include "base/base_export.h" |
| 11 #include "base/macros.h" |
| 12 #include "base/threading/thread_checker.h" |
| 13 |
| 14 namespace base { |
| 15 namespace trace_event { |
| 16 |
| 17 class TraceBufferChunk; |
| 18 struct TraceEventHandle; |
| 19 class TraceEvent; |
| 20 |
| 21 class BASE_EXPORT ThreadLocalEventBuffer { |
| 22 public: |
| 23 ThreadLocalEventBuffer(int generation); |
| 24 ~ThreadLocalEventBuffer(); |
| 25 |
| 26 TraceEvent* AddTraceEvent(TraceEventHandle* handle); |
| 27 TraceEvent* GetEventByHandle(TraceEventHandle handle); |
| 28 void Flush(); |
| 29 int generation() const { return generation_; } |
| 30 TraceBufferChunk* chunk() const { return chunk_.get(); } |
| 31 |
| 32 private: |
| 33 std::unique_ptr<TraceBufferChunk> chunk_; |
| 34 ThreadChecker thread_checker_; |
| 35 size_t chunk_index_; |
| 36 const int generation_; |
| 37 |
| 38 DISALLOW_COPY_AND_ASSIGN(ThreadLocalEventBuffer); |
| 39 }; |
| 40 |
| 41 } // namespace trace_event |
| 42 } // namespace base |
| 43 |
| 44 #endif // BASE_TRACE_EVENT_THREAD_LOCAL_EVENT_BUFFER_H_ |
| OLD | NEW |