| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef BASE_TRACE_EVENT_TRACING_AGENT_H_ | 5 #ifndef BASE_TRACE_EVENT_TRACING_AGENT_H_ |
| 6 #define BASE_TRACE_EVENT_TRACING_AGENT_H_ | 6 #define BASE_TRACE_EVENT_TRACING_AGENT_H_ |
| 7 | 7 |
| 8 #include "base/base_export.h" | 8 #include "base/base_export.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/memory/ref_counted_memory.h" | 10 #include "base/memory/ref_counted_memory.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 // DebugDaemonClient for CrOs system trace, EtwSystemEventConsumer for Windows | 25 // DebugDaemonClient for CrOs system trace, EtwSystemEventConsumer for Windows |
| 26 // system trace and PowerTracingAgent for BattOr power trace. | 26 // system trace and PowerTracingAgent for BattOr power trace. |
| 27 class BASE_EXPORT TracingAgent { | 27 class BASE_EXPORT TracingAgent { |
| 28 public: | 28 public: |
| 29 using StopAgentTracingCallback = base::Callback<void( | 29 using StopAgentTracingCallback = base::Callback<void( |
| 30 const std::string& agent_name, | 30 const std::string& agent_name, |
| 31 const std::string& events_label, | 31 const std::string& events_label, |
| 32 const scoped_refptr<base::RefCountedString>& events_str_ptr)>; | 32 const scoped_refptr<base::RefCountedString>& events_str_ptr)>; |
| 33 using RecordClockSyncMarkerCallback = base::Callback<void( | 33 using RecordClockSyncMarkerCallback = base::Callback<void( |
| 34 int sync_id, | 34 int sync_id, |
| 35 const TimeTicks& sync_ts, | 35 const TimeTicks& issue_ts, |
| 36 const TimeTicks& sync_end_ts)>; | 36 const TimeTicks& issue_end_ts)>; |
| 37 | 37 |
| 38 virtual ~TracingAgent(); | 38 virtual ~TracingAgent(); |
| 39 | 39 |
| 40 // Gets the name of the tracing agent. Each tracing agent's name should be | 40 // Gets the name of the tracing agent. Each tracing agent's name should be |
| 41 // unique. | 41 // unique. |
| 42 virtual std::string GetTracingAgentName() = 0; | 42 virtual std::string GetTracingAgentName() = 0; |
| 43 | 43 |
| 44 // Gets the trace event label of this tracing agent. The label will be used to | 44 // Gets the trace event label of this tracing agent. The label will be used to |
| 45 // label this agent's trace when all traces from different tracing agents are | 45 // label this agent's trace when all traces from different tracing agents are |
| 46 // combined. Multiple tracing agents could have the same label. The tracing | 46 // combined. Multiple tracing agents could have the same label. The tracing |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 // is true in Chrome because all agent threads' clocks are Chrome clock. | 83 // is true in Chrome because all agent threads' clocks are Chrome clock. |
| 84 virtual void RecordClockSyncMarker( | 84 virtual void RecordClockSyncMarker( |
| 85 int sync_id, | 85 int sync_id, |
| 86 const RecordClockSyncMarkerCallback& callback); | 86 const RecordClockSyncMarkerCallback& callback); |
| 87 }; | 87 }; |
| 88 | 88 |
| 89 } // namespace trace_event | 89 } // namespace trace_event |
| 90 } // namespace base | 90 } // namespace base |
| 91 | 91 |
| 92 #endif // BASE_TRACE_EVENT_TRACING_AGENT_H_ | 92 #endif // BASE_TRACE_EVENT_TRACING_AGENT_H_ |
| OLD | NEW |