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"
11 template <typename Type
>
12 struct DefaultSingletonTraits
;
16 class BattorPowerTraceProvider
;
18 class PowerTracingAgent
{
20 typedef base::Callback
<void(const scoped_refptr
<base::RefCountedString
>&)>
24 void StopTracing(const OutputCallback
& callback
);
26 // Retrieve the singleton instance.
27 static PowerTracingAgent
* GetInstance();
30 // This allows constructor and destructor to be private and usable only
31 // by the Singleton class.
32 friend struct DefaultSingletonTraits
<PowerTracingAgent
>;
36 virtual ~PowerTracingAgent();
38 void OnStopTracingDone(const OutputCallback
& callback
,
39 const scoped_refptr
<base::RefCountedString
>& result
);
41 void FlushOnThread(const OutputCallback
& callback
);
43 scoped_ptr
<BattorPowerTraceProvider
> battor_trace_provider_
;
46 DISALLOW_COPY_AND_ASSIGN(PowerTracingAgent
);
49 } // namespace content
51 #endif // CONTENT_BROWSER_TRACING_POWER_TRACING_AGENT_H_