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_PERSISTENT_ASYNC_H_ | |
6 #define BASE_TRACE_EVENT_PERSISTENT_ASYNC_H_ | |
7 | |
8 #include "base/macros.h" | |
9 #include "base/time/time.h" | |
10 #include "base/trace_event/trace_event.h" | |
11 | |
12 namespace base { | |
13 | |
Primiano Tucci (use gerrit)
2016/09/14 09:38:54
nit: remove this extra space
alexandermont
2016/09/14 20:14:57
Done
| |
14 namespace trace_event { | |
15 | |
16 class BASE_EXPORT PersistentAsyncEvent | |
17 : public trace_event::TraceLog::EnabledStateObserver { | |
Primiano Tucci (use gerrit)
2016/09/14 09:38:54
Can this object be created and destroyed on differ
alexandermont
2016/09/14 20:14:56
Done
| |
18 public: | |
19 PersistentAsyncEvent(const char* category, const char* event_name); | |
20 ~PersistentAsyncEvent() override; | |
21 | |
22 void Begin(); | |
23 void End(); | |
24 | |
25 void OnTraceLogEnabled() override; | |
Primiano Tucci (use gerrit)
2016/09/14 09:38:54
nit: add // EnabledStateObserver implementation
A
alexandermont
2016/09/14 20:14:57
Added comment. How could you put these in the priv
Primiano Tucci (use gerrit)
2016/09/15 10:08:29
The TraceLog calls the methods on the base class,
| |
26 void OnTraceLogDisabled() override; | |
27 | |
28 private: | |
29 bool active_; | |
Primiano Tucci (use gerrit)
2016/09/14 09:38:54
Active seems a redundant field here. If I read the
alexandermont
2016/09/14 20:14:57
Well, actually, start_time doesn't get initialized
Primiano Tucci (use gerrit)
2016/09/15 10:08:29
It does, implicitly.
TimeTicks is a non-POD type a
| |
30 void* id_; | |
31 const char* category_; | |
Primiano Tucci (use gerrit)
2016/09/14 09:38:54
const char* const category_;
ditto for event_name
alexandermont
2016/09/14 20:14:57
I'll put that in there, but what does it do?
Primiano Tucci (use gerrit)
2016/09/15 10:08:29
const char* foo -> foo is a pointer to const char.
| |
32 const char* event_name_; | |
33 base::TimeTicks start_time_; | |
34 }; | |
Primiano Tucci (use gerrit)
2016/09/14 09:38:54
DISALLOW_COPY_AND_ASSIGN
alexandermont
2016/09/14 20:14:57
Done
| |
35 | |
36 } // namespace trace_event | |
37 } // namespace base | |
38 | |
39 #endif // BASE_TRACE_EVENT_PERSISTENT_ASYNC_H_ | |
OLD | NEW |