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

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, 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: 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..4579b605ad642866a9f503293de06cc8906ab413 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,22 @@ 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();
+ std::string GetTracingAgentName() override;
Primiano Tucci (use gerrit) 2015/12/01 11:42:43 Typically you want to add a comment like: // base
Zhen Wang 2015/12/01 18:02:53 Done.
+ 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(scoped_ptr<base::DictionaryValue> marker) override;
+ void IssueClockSyncMarker() override;
+
private:
// This allows constructor and destructor to be private and usable only
// by the Singleton class.
@@ -35,12 +41,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_;

Powered by Google App Engine
This is Rietveld 408576698