Chromium Code Reviews| 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 namespace trace_event { | |
| 14 | |
| 15 // Note: The categories and event names must have application lifetime | |
| 16 // (strings or literals), as documented in trace_event_common.h. | |
|
charliea (OOO until 10-5)
2016/08/29 17:27:27
nit: aren't "string literals" a thing? "(i.e. lite
alexandermont
2016/08/29 18:59:07
Done
| |
| 17 // Thus, we must makes subclasses that have hard-coded categories | |
|
benjhayden
2016/08/28 05:17:20
"must make" not "makes"
alexandermont
2016/08/29 18:59:06
Done
| |
| 18 // and event names, rather than passing these into the PersistentAsyncEvent. | |
| 19 | |
| 20 class BASE_EXPORT PersistentAsyncEvent | |
| 21 : public trace_event::TraceLog::EnabledStateObserver { | |
| 22 public: | |
|
charliea (OOO until 10-5)
2016/08/29 17:27:27
nit: I think the whitespace is off here. Would you
alexandermont
2016/08/29 18:59:06
Done
| |
| 23 PersistentAsyncEvent(size_t id); | |
| 24 ~PersistentAsyncEvent() override; | |
| 25 | |
| 26 void Start(); | |
| 27 void Stop(); | |
| 28 | |
| 29 virtual void RecordStartEvent(); | |
|
benjhayden
2016/08/28 05:17:20
The default implementations of these 3 methods don
alexandermont
2016/08/29 18:59:06
Done
| |
| 30 virtual void RecordStartEventWithTimestamp(int64_t timestamp); | |
| 31 virtual void RecordStopEvent(); | |
| 32 void OnTraceLogEnabled() override; | |
| 33 void OnTraceLogDisabled() override; | |
| 34 | |
| 35 protected: | |
| 36 | |
|
charliea (OOO until 10-5)
2016/08/29 17:27:27
I don't think we usually add a blank line before t
alexandermont
2016/08/29 18:59:06
Done
| |
| 37 size_t id_; | |
| 38 bool active_; | |
| 39 int64_t start_time_; | |
|
charliea (OOO until 10-5)
2016/08/29 17:27:27
Why are we using int64_t to represent time instead
alexandermont
2016/08/29 18:59:06
See above. TRACE_EVENT_ASYNC_BEGIN_WITH_TIMESTAMP0
| |
| 40 }; | |
| 41 | |
| 42 } | |
|
benjhayden
2016/08/28 05:17:21
"Terminate namespaces with comments as shown in th
alexandermont
2016/08/29 18:59:07
Done
| |
| 43 } | |
| 44 | |
| 45 #endif // BASE_TRACE_EVENT_PERSISTENT_ASYNC_H_ | |
| OLD | NEW |