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

Unified Diff: content/browser/devtools/devtools_power_handler.h

Issue 140583003: Chrome power profiler service (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: remove timeout from tests, patch for landing Created 6 years, 10 months 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/devtools/devtools_power_handler.h
diff --git a/content/browser/devtools/devtools_power_handler.h b/content/browser/devtools/devtools_power_handler.h
new file mode 100644
index 0000000000000000000000000000000000000000..e82021fb7fe1b79841b9af56c73c692a64496621
--- /dev/null
+++ b/content/browser/devtools/devtools_power_handler.h
@@ -0,0 +1,36 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_POWER_HANDLER_H_
+#define CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_POWER_HANDLER_H_
+
+#include "base/time/time.h"
+#include "content/browser/devtools/devtools_protocol.h"
+#include "content/browser/power_profiler/power_profiler_observer.h"
+
+namespace content {
+
+// This class provides power information to DevTools.
+class DevToolsPowerHandler
+ : public DevToolsProtocol::Handler,
+ public PowerProfilerObserver {
+ public:
+ DevToolsPowerHandler();
+ virtual ~DevToolsPowerHandler();
+
+ // PowerProfilerObserver override.
+ virtual void OnPowerEvent(const PowerEventVector&) OVERRIDE;
+
+ private:
+ scoped_refptr<DevToolsProtocol::Response> OnStart(
+ scoped_refptr<DevToolsProtocol::Command> command);
+ scoped_refptr<DevToolsProtocol::Response> OnEnd(
+ scoped_refptr<DevToolsProtocol::Command> command);
+
+ DISALLOW_COPY_AND_ASSIGN(DevToolsPowerHandler);
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_POWER_HANDLER_H_

Powered by Google App Engine
This is Rietveld 408576698