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

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

Issue 1468173003: [Tracing Clock Sync] Add TracingAgent interface in Chrome (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef BASE_TRACE_EVENT_TRACING_AGENT_H_
6 #define BASE_TRACE_EVENT_TRACING_AGENT_H_
7
8 #include "base/base_export.h"
9 #include "base/callback.h"
10 #include "base/memory/ref_counted_memory.h"
11 #include "base/trace_event/trace_config.h"
12 #include "base/values.h"
13
14 namespace base {
15 namespace trace_event {
16
oystein (OOO til 10th of July) 2015/11/24 22:52:10 Can you include some class-level comments here, cl
Zhen Wang 2015/11/25 04:24:55 Done.
17 class BASE_EXPORT TracingAgent {
18 public:
19 typedef base::Callback<void(const scoped_refptr<base::RefCountedString>&)>
20 StopAgentTracingCallback;
21
22 // Get the name of the tracing agent. The name should be one of the possible
23 // tracing agent names declared below.
24 virtual std::string GetTracingAgentName() = 0;
25
26 // Start tracing on the tracing agent.
27 virtual bool StartAgentTracing(const TraceConfig& trace_config) = 0;
28
29 // Stop tracing on the tracing agent.
30 virtual void StopAgentTracing(const StopAgentTracingCallback& callback) = 0;
31
32 // Check if the tracing agent supports explicit clock synchronization.
33 virtual bool SupportsExplicitClockSync() = 0;
34
35 // Record a clock sync marker issued by another tracing agent.
36 virtual void RecordClockSyncMarker(
37 scoped_ptr<base::DictionaryValue> marker) = 0;
38
39 // Issue clock sync markers to other tracing agents if possible.
40 virtual void IssueClockSyncMarker() = 0;
41
42 virtual ~TracingAgent() {}
43
44 protected:
45 // Declare all possible tracing agent names here.
46 static const char kChromeTracingAgentName[];
oystein (OOO til 10th of July) 2015/11/24 22:52:10 Hmm why are these hardcoded here? It doesn't seem
Zhen Wang 2015/11/25 04:24:55 I originally thought about returning those strings
47 static const char kETWTracingAgentName[];
48 static const char kCrOSTracingAgentName[];
49 static const char kPowerTracingAgentName[];
50 };
51
52 } // namespace trace_event
53 } // namespace base
54
55 #endif // BASE_TRACE_EVENT_TRACING_AGENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698