diff options
Diffstat (limited to 'content/browser/tracing/power_tracing_agent.h')
-rw-r--r-- | content/browser/tracing/power_tracing_agent.h | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/content/browser/tracing/power_tracing_agent.h b/content/browser/tracing/power_tracing_agent.h index 3c897d6..d72b1cb 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_; |