Index: base/trace_event/tracing_agent.h |
diff --git a/base/trace_event/tracing_agent.h b/base/trace_event/tracing_agent.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..3ac0c3984c90a4f8668accf6960bf902576bcc6a |
--- /dev/null |
+++ b/base/trace_event/tracing_agent.h |
@@ -0,0 +1,55 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef BASE_TRACE_EVENT_TRACING_AGENT_H_ |
+#define BASE_TRACE_EVENT_TRACING_AGENT_H_ |
+ |
+#include "base/base_export.h" |
+#include "base/callback.h" |
+#include "base/memory/ref_counted_memory.h" |
+#include "base/trace_event/trace_config.h" |
+#include "base/values.h" |
+ |
+namespace base { |
+namespace trace_event { |
+ |
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.
|
+class BASE_EXPORT TracingAgent { |
+ public: |
+ typedef base::Callback<void(const scoped_refptr<base::RefCountedString>&)> |
+ StopAgentTracingCallback; |
+ |
+ // Get the name of the tracing agent. The name should be one of the possible |
+ // tracing agent names declared below. |
+ virtual std::string GetTracingAgentName() = 0; |
+ |
+ // Start tracing on the tracing agent. |
+ virtual bool StartAgentTracing(const TraceConfig& trace_config) = 0; |
+ |
+ // Stop tracing on the tracing agent. |
+ virtual void StopAgentTracing(const StopAgentTracingCallback& callback) = 0; |
+ |
+ // Check if the tracing agent supports explicit clock synchronization. |
+ virtual bool SupportsExplicitClockSync() = 0; |
+ |
+ // Record a clock sync marker issued by another tracing agent. |
+ virtual void RecordClockSyncMarker( |
+ scoped_ptr<base::DictionaryValue> marker) = 0; |
+ |
+ // Issue clock sync markers to other tracing agents if possible. |
+ virtual void IssueClockSyncMarker() = 0; |
+ |
+ virtual ~TracingAgent() {} |
+ |
+ protected: |
+ // Declare all possible tracing agent names here. |
+ 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
|
+ static const char kETWTracingAgentName[]; |
+ static const char kCrOSTracingAgentName[]; |
+ static const char kPowerTracingAgentName[]; |
+}; |
+ |
+} // namespace trace_event |
+} // namespace base |
+ |
+#endif // BASE_TRACE_EVENT_TRACING_AGENT_H_ |