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

Unified 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 side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698