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
3 // found in the LICENSE file.
5 #ifndef CONTENT_BROWSER_TRACING_POWER_TRACING_AGENT_H_
6 #define CONTENT_BROWSER_TRACING_POWER_TRACING_AGENT_H_
8 #include "base/memory/ref_counted_memory.h"
9 #include "base/threading/thread.h"
12 template <typename Type
>
13 struct DefaultSingletonTraits
;
18 class BattorPowerTraceProvider
;
20 class PowerTracingAgent
{
22 typedef base::Callback
<void(const scoped_refptr
<base::RefCountedString
>&)>
26 void StopTracing(const OutputCallback
& callback
);
28 // Retrieve the singleton instance.
29 static PowerTracingAgent
* GetInstance();
32 // This allows constructor and destructor to be private and usable only
33 // by the Singleton class.
34 friend struct base::DefaultSingletonTraits
<PowerTracingAgent
>;
38 virtual ~PowerTracingAgent();
40 void OnStopTracingDone(const OutputCallback
& callback
,
41 const scoped_refptr
<base::RefCountedString
>& result
);
43 void FlushOnThread(const OutputCallback
& callback
);
45 scoped_ptr
<BattorPowerTraceProvider
> battor_trace_provider_
;
48 DISALLOW_COPY_AND_ASSIGN(PowerTracingAgent
);
51 } // namespace content
53 #endif // CONTENT_BROWSER_TRACING_POWER_TRACING_AGENT_H_