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

Unified Diff: chrome/browser/devtools/devtools_power_profiler_host.h

Issue 106223002: chrome power profiler chrome side changes (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 6 years, 11 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: chrome/browser/devtools/devtools_power_profiler_host.h
diff --git a/chrome/browser/devtools/devtools_power_profiler_host.h b/chrome/browser/devtools/devtools_power_profiler_host.h
new file mode 100644
index 0000000000000000000000000000000000000000..50e2f550cbea23a3cd8852f23a2643d95e8f8f54
--- /dev/null
+++ b/chrome/browser/devtools/devtools_power_profiler_host.h
@@ -0,0 +1,33 @@
+// 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 CHROME_BROWSER_DEVTOOLS_DEVTOOLS_POWER_PROFILER_HOST_H_
+#define CHROME_BROWSER_DEVTOOLS_DEVTOOLS_POWER_PROFILER_HOST_H_
+
+#include "base/basictypes.h"
+#include "base/memory/ref_counted.h"
+#include "base/memory/weak_ptr.h"
+#include "base/values.h"
+#include "chrome/browser/devtools/devtools_window.h"
+#include "content/public/browser/power_profiler_observer.h"
+
+class DevToolsWindow;
+
+// A class used to monitor the power usage and tell profiler the power data
+class DevToolsPowerProfilerHost : public content::PowerProfilerObserver {
+ public:
+ explicit DevToolsPowerProfilerHost(const base::WeakPtr<DevToolsWindow>&);
+ ~DevToolsPowerProfilerHost() {}
+ virtual void Send(content::PowerEvent*) OVERRIDE;
+
+ private:
+ void SendWrapper(const std::string& message);
+ base::Time convertMonotonicTimeToWallTime(base::TimeTicks&);
+ void convertPowerValueToJSONObject(base::DictionaryValue*,
+ content::PowerEvent*);
+ base::WeakPtr<DevToolsWindow> frontend_host_;
+ DISALLOW_COPY_AND_ASSIGN(DevToolsPowerProfilerHost);
+};
+
+#endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_POWER_PROFILER_HOST_H_

Powered by Google App Engine
This is Rietveld 408576698