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

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

Issue 1637933002: trace_controller: Makes StopTracing callback ignore empty event strings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months 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 | « no previous file | content/browser/tracing/tracing_controller_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
11 #include "base/values.h" 11 #include "base/values.h"
12 12
13 namespace base { 13 namespace base {
14 14
15 class TimeTicks; 15 class TimeTicks;
16 16
17 namespace trace_event { 17 namespace trace_event {
18 18
19 class TraceConfig; 19 class TraceConfig;
20 20
21 // A tracing agent is an entity that records its own sort of trace. Each 21 // A tracing agent is an entity that records its own sort of trace. Each
22 // tracing method that produces its own trace log should implement this 22 // tracing method that produces its own trace log should implement this
23 // interface. All tracing agents must only be controlled by TracingController. 23 // interface. All tracing agents must only be controlled by TracingController.
24 // Some existing examples include TracingControllerImpl for Chrome trace events, 24 // Some existing examples include TracingControllerImpl for Chrome trace events,
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 // Passing a null or empty events_str_ptr indicates that no trace data is
30 // available for the specified agent.
charliea (OOO until 10-5) 2016/01/26 17:58:57 Here I chose to treat both null and empty events_s
29 using StopAgentTracingCallback = base::Callback<void( 31 using StopAgentTracingCallback = base::Callback<void(
30 const std::string& agent_name, 32 const std::string& agent_name,
31 const std::string& events_label, 33 const std::string& events_label,
32 const scoped_refptr<base::RefCountedString>& events_str_ptr)>; 34 const scoped_refptr<base::RefCountedString>& events_str_ptr)>;
33 using RecordClockSyncMarkerCallback = base::Callback<void( 35 using RecordClockSyncMarkerCallback = base::Callback<void(
34 int sync_id, 36 int sync_id,
35 const TimeTicks& issue_ts, 37 const TimeTicks& issue_ts,
36 const TimeTicks& issue_end_ts)>; 38 const TimeTicks& issue_end_ts)>;
37 39
38 virtual ~TracingAgent(); 40 virtual ~TracingAgent();
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 // is true in Chrome because all agent threads' clocks are Chrome clock. 85 // is true in Chrome because all agent threads' clocks are Chrome clock.
84 virtual void RecordClockSyncMarker( 86 virtual void RecordClockSyncMarker(
85 int sync_id, 87 int sync_id,
86 const RecordClockSyncMarkerCallback& callback); 88 const RecordClockSyncMarkerCallback& callback);
87 }; 89 };
88 90
89 } // namespace trace_event 91 } // namespace trace_event
90 } // namespace base 92 } // namespace base
91 93
92 #endif // BASE_TRACE_EVENT_TRACING_AGENT_H_ 94 #endif // BASE_TRACE_EVENT_TRACING_AGENT_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/tracing/tracing_controller_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698