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

Unified Diff: content/browser/power_profiler/Intel/power_profiler_helper_ia.h

Issue 106223002: chrome power profiler chrome side changes (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years 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/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_

Powered by Google App Engine
This is Rietveld 408576698