| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_BROWSER_TRACING_POWER_TRACING_AGENT_H_ | 5 #ifndef CONTENT_BROWSER_TRACING_POWER_TRACING_AGENT_H_ |
| 6 #define CONTENT_BROWSER_TRACING_POWER_TRACING_AGENT_H_ | 6 #define CONTENT_BROWSER_TRACING_POWER_TRACING_AGENT_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/ref_counted_memory.h" | 9 #include "base/memory/ref_counted_memory.h" |
| 10 #include "base/threading/thread.h" | 10 #include "base/threading/thread.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 // base::trace_event::TracingAgent implementation. | 27 // base::trace_event::TracingAgent implementation. |
| 28 std::string GetTracingAgentName() override; | 28 std::string GetTracingAgentName() override; |
| 29 std::string GetTraceEventLabel() override; | 29 std::string GetTraceEventLabel() override; |
| 30 | 30 |
| 31 void StartAgentTracing(const base::trace_event::TraceConfig& trace_config, | 31 void StartAgentTracing(const base::trace_event::TraceConfig& trace_config, |
| 32 const StartAgentTracingCallback& callback) override; | 32 const StartAgentTracingCallback& callback) override; |
| 33 void StopAgentTracing(const StopAgentTracingCallback& callback) override; | 33 void StopAgentTracing(const StopAgentTracingCallback& callback) override; |
| 34 | 34 |
| 35 bool SupportsExplicitClockSync() override; | 35 bool SupportsExplicitClockSync() override; |
| 36 void RecordClockSyncMarker( | 36 void RecordClockSyncMarker( |
| 37 int sync_id, | 37 const std::string& sync_id, |
| 38 const RecordClockSyncMarkerCallback& callback) override; | 38 const RecordClockSyncMarkerCallback& callback) override; |
| 39 | 39 |
| 40 private: | 40 private: |
| 41 // This allows constructor and destructor to be private and usable only | 41 // This allows constructor and destructor to be private and usable only |
| 42 // by the Singleton class. | 42 // by the Singleton class. |
| 43 friend struct base::DefaultSingletonTraits<PowerTracingAgent>; | 43 friend struct base::DefaultSingletonTraits<PowerTracingAgent>; |
| 44 | 44 |
| 45 // Constructor. | 45 // Constructor. |
| 46 PowerTracingAgent(); | 46 PowerTracingAgent(); |
| 47 ~PowerTracingAgent() override; | 47 ~PowerTracingAgent() override; |
| 48 | 48 |
| 49 void OnStopTracingDone(const StopAgentTracingCallback& callback, | 49 void OnStopTracingDone(const StopAgentTracingCallback& callback, |
| 50 const scoped_refptr<base::RefCountedString>& result); | 50 const scoped_refptr<base::RefCountedString>& result); |
| 51 | 51 |
| 52 void TraceOnThread(); | 52 void TraceOnThread(); |
| 53 void FlushOnThread(const StopAgentTracingCallback& callback); | 53 void FlushOnThread(const StopAgentTracingCallback& callback); |
| 54 void RecordClockSyncMarkerOnThread( | 54 void RecordClockSyncMarkerOnThread( |
| 55 int sync_id, | 55 const std::string& sync_id, |
| 56 const RecordClockSyncMarkerCallback& callback); | 56 const RecordClockSyncMarkerCallback& callback); |
| 57 | 57 |
| 58 base::Thread thread_; | 58 base::Thread thread_; |
| 59 scoped_ptr<BattorPowerTraceProvider> battor_trace_provider_; | 59 scoped_ptr<BattorPowerTraceProvider> battor_trace_provider_; |
| 60 | 60 |
| 61 DISALLOW_COPY_AND_ASSIGN(PowerTracingAgent); | 61 DISALLOW_COPY_AND_ASSIGN(PowerTracingAgent); |
| 62 }; | 62 }; |
| 63 | 63 |
| 64 } // namespace content | 64 } // namespace content |
| 65 | 65 |
| 66 #endif // CONTENT_BROWSER_TRACING_POWER_TRACING_AGENT_H_ | 66 #endif // CONTENT_BROWSER_TRACING_POWER_TRACING_AGENT_H_ |
| OLD | NEW |