Index: content/browser/power_profiler/Intel/power_profiler_helper_ia.h |
diff --git a/content/browser/power_profiler/Intel/power_profiler_helper_ia.h b/content/browser/power_profiler/Intel/power_profiler_helper_ia.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..b138126bb6694a15f23791e3995f57d28dfe3af5 |
--- /dev/null |
+++ b/content/browser/power_profiler/Intel/power_profiler_helper_ia.h |
@@ -0,0 +1,51 @@ |
+// Copyright 2013 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_POWER_PROFILER_HELPER_IA_H_ |
+#define CONTENT_BROWSER_POWER_PROFILER_HELPER_IA_H_ |
+ |
+#include "base/basictypes.h" |
+#include "base/memory/ref_counted.h" |
+#include "base/win/scoped_com_initializer.h" |
+#include "content/browser/power_profiler/power_event.h" |
+#include "content/browser/power_profiler/power_profiler_helper.h" |
+ |
+ |
+#if defined(OS_WIN) |
+#include <windows.h> |
qsr
2014/01/17 11:50:14
why is this conditional to windows? Right now, thi
|
+#include "third_party/power_gadget/IntelPowerGadgetLib.h" |
+#define ENABLE_POWER_PROFILER 1 |
+#else |
+#undef ENABLE_POWER_PROFILE |
+#endif // !OS_WIN |
+ |
+namespace content { |
+ |
+// A class used to GET power usage via Power Gadget API |
+class PowerProfilerHelperIA : public PowerProfilerHelper { |
+ public: |
+ virtual ~PowerProfilerHelperIA(); |
+ |
+ virtual bool Initialize() OVERRIDE; |
+ virtual void Reset(size_t) OVERRIDE; |
+ virtual int GetData(PowerEvent* data, double* energies, int count) OVERRIDE; |
+ |
+ protected: |
+ PowerProfilerHelperIA(); |
+ |
+ private: |
+ friend class PowerProfilerHelperFactory; |
+ |
+#if defined(OS_WIN) |
+ CIntelPowerGadgetLib energy_lib_; |
+#endif |
+ int sockets_number_; |
+ int power_msr_ids_[PowerEvent::ID_COUNT]; |
+ bool is_open_; |
+ DISALLOW_COPY_AND_ASSIGN(PowerProfilerHelperIA); |
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_BROWSER_POWER_PROFILER_HELPER_IA_H_ |