Revert 268405 "Make sure that ScratchBuffer::Allocate() always r..."
[chromium-blink-merge.git] / content / browser / devtools / devtools_power_handler.h
blobf645392a1993a81a139f4e56d85f89638097111d
1 // Copyright 2014 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_DEVTOOLS_DEVTOOLS_POWER_HANDLER_H_
6 #define CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_POWER_HANDLER_H_
8 #include "base/time/time.h"
9 #include "content/browser/devtools/devtools_protocol.h"
10 #include "content/browser/power_profiler/power_profiler_observer.h"
12 namespace content {
14 // This class provides power information to DevTools.
15 class DevToolsPowerHandler
16 : public DevToolsProtocol::Handler,
17 public PowerProfilerObserver {
18 public:
19 DevToolsPowerHandler();
20 virtual ~DevToolsPowerHandler();
22 // PowerProfilerObserver override.
23 virtual void OnPowerEvent(const PowerEventVector&) OVERRIDE;
25 private:
26 scoped_refptr<DevToolsProtocol::Response> OnStart(
27 scoped_refptr<DevToolsProtocol::Command> command);
28 scoped_refptr<DevToolsProtocol::Response> OnEnd(
29 scoped_refptr<DevToolsProtocol::Command> command);
30 scoped_refptr<DevToolsProtocol::Response> OnCanProfilePower(
31 scoped_refptr<DevToolsProtocol::Command> command);
33 DISALLOW_COPY_AND_ASSIGN(DevToolsPowerHandler);
36 } // namespace content
38 #endif // CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_POWER_HANDLER_H_