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/trace_event/trace_event.h" | |
| 10 #include <string> | |
| 11 #include <ctime> | |
| 12 | |
| 13 namespace base { | |
| 14 namespace trace_event { | |
| 15 | |
| 16 // Note: The categories and event names must have application lifetime | |
|
charliea (OOO until 10-5)
2016/07/19 20:27:18
Take a look at https://cs.chromium.org/chromium/sr
| |
| 17 // (strings or literals), as documented in trace_event_common.h. | |
| 18 // Thus, we must makes subclasses that have hard-coded categories | |
| 19 // and event names, rather than passing these into the PersistentAsyncEvent. | |
| 20 | |
| 21 class BASE_EXPORT PersistentAsyncEvent | |
| 22 : public trace_event::TraceLog::EnabledStateObserver { | |
| 23 public: | |
|
benjhayden
2016/08/10 18:30:00
These should only be indented by 1 space.
| |
| 24 PersistentAsyncEvent(); | |
| 25 ~PersistentAsyncEvent() override; | |
| 26 | |
| 27 void Start(std::string param_value = ""); | |
| 28 void Stop(std::string param_value = ""); | |
| 29 | |
| 30 virtual void RecordStartEvent(); | |
| 31 virtual void RecordStartEventWithOffset(double offset); | |
| 32 virtual void RecordStopEvent(); | |
| 33 void OnTraceLogEnabled() override; | |
| 34 void OnTraceLogDisabled() override; | |
| 35 | |
| 36 protected: | |
|
benjhayden
2016/08/10 18:30:00
only indent by 1 space
| |
| 37 std::string param_value_; | |
| 38 | |
| 39 bool active_; | |
| 40 timeval start_time_; | |
| 41 }; | |
| 42 | |
| 43 } | |
|
benjhayden
2016/08/10 18:30:00
} // namespace trace_event
| |
| 44 } | |
|
benjhayden
2016/08/10 18:30:00
} // namespace base
| |
| 45 | |
| 46 #endif // BASE_TRACE_EVENT_PERSISTENT_ASYNC_H_ | |
| OLD | NEW |