Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Side by Side Diff: base/trace_event/thread_local_event_buffer.h

Issue 2503473002: tracing: split out ThreadLocalEventBuffer
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/BUILD.gn ('k') | base/trace_event/thread_local_event_buffer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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_
OLDNEW
« no previous file with comments | « base/BUILD.gn ('k') | base/trace_event/thread_local_event_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698