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

Unified Diff: content/browser/tracing/power_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: review fix Created 5 years 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: content/browser/tracing/power_tracing_agent.h
diff --git a/content/browser/tracing/power_tracing_agent.h b/content/browser/tracing/power_tracing_agent.h
index 3c897d6753df931394354bfeca13814d668feac0..d72b1cb3f57c17d4016b415decaaa635eb6fd33e 100644
--- a/content/browser/tracing/power_tracing_agent.h
+++ b/content/browser/tracing/power_tracing_agent.h
@@ -7,6 +7,7 @@
#include "base/memory/ref_counted_memory.h"
#include "base/threading/thread.h"
+#include "base/trace_event/tracing_agent.h"
namespace base {
template <typename Type>
@@ -17,17 +18,24 @@ namespace content {
class BattorPowerTraceProvider;
-class PowerTracingAgent {
+class PowerTracingAgent : public base::trace_event::TracingAgent {
public:
- typedef base::Callback<void(const scoped_refptr<base::RefCountedString>&)>
- OutputCallback;
-
- bool StartTracing();
- void StopTracing(const OutputCallback& callback);
-
// Retrieve the singleton instance.
static PowerTracingAgent* GetInstance();
+ // base::trace_event::TracingAgent implementation.
+ std::string GetTracingAgentName() override;
+ std::string GetTraceEventLabel() override;
+
+ bool StartAgentTracing(
+ const base::trace_event::TraceConfig& trace_config) override;
+ void StopAgentTracing(const StopAgentTracingCallback& callback) override;
+
+ bool SupportsExplicitClockSync() override;
+ void RecordClockSyncMarker(
+ int sync_id,
+ const RecordClockSyncMarkerCallback& callback) override;
+
private:
// This allows constructor and destructor to be private and usable only
// by the Singleton class.
@@ -35,12 +43,12 @@ class PowerTracingAgent {
// Constructor.
PowerTracingAgent();
- virtual ~PowerTracingAgent();
+ ~PowerTracingAgent() override;
- void OnStopTracingDone(const OutputCallback& callback,
+ void OnStopTracingDone(const StopAgentTracingCallback& callback,
const scoped_refptr<base::RefCountedString>& result);
- void FlushOnThread(const OutputCallback& callback);
+ void FlushOnThread(const StopAgentTracingCallback& callback);
scoped_ptr<BattorPowerTraceProvider> battor_trace_provider_;
bool is_tracing_;
« no previous file with comments | « content/browser/tracing/etw_system_event_consumer_win.cc ('k') | content/browser/tracing/power_tracing_agent.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698