Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2013 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. | |
| 4 | |
| 5 #ifndef CONTENT_BROWSER_POWER_PROFILER_HELPER_IA_H_ | |
| 6 #define CONTENT_BROWSER_POWER_PROFILER_HELPER_IA_H_ | |
| 7 | |
| 8 #include "base/basictypes.h" | |
| 9 #include "base/memory/ref_counted.h" | |
| 10 #include "base/win/scoped_com_initializer.h" | |
| 11 #include "content/browser/power_profiler/power_event.h" | |
| 12 #include "content/browser/power_profiler/power_profiler_helper.h" | |
| 13 | |
| 14 | |
| 15 #if defined(OS_WIN) | |
| 16 #include <windows.h> | |
|
qsr
2014/01/17 11:50:14
why is this conditional to windows? Right now, thi
| |
| 17 #include "third_party/power_gadget/IntelPowerGadgetLib.h" | |
| 18 #define ENABLE_POWER_PROFILER 1 | |
| 19 #else | |
| 20 #undef ENABLE_POWER_PROFILE | |
| 21 #endif // !OS_WIN | |
| 22 | |
| 23 namespace content { | |
| 24 | |
| 25 // A class used to GET power usage via Power Gadget API | |
| 26 class PowerProfilerHelperIA : public PowerProfilerHelper { | |
| 27 public: | |
| 28 virtual ~PowerProfilerHelperIA(); | |
| 29 | |
| 30 virtual bool Initialize() OVERRIDE; | |
| 31 virtual void Reset(size_t) OVERRIDE; | |
| 32 virtual int GetData(PowerEvent* data, double* energies, int count) OVERRIDE; | |
| 33 | |
| 34 protected: | |
| 35 PowerProfilerHelperIA(); | |
| 36 | |
| 37 private: | |
| 38 friend class PowerProfilerHelperFactory; | |
| 39 | |
| 40 #if defined(OS_WIN) | |
| 41 CIntelPowerGadgetLib energy_lib_; | |
| 42 #endif | |
| 43 int sockets_number_; | |
| 44 int power_msr_ids_[PowerEvent::ID_COUNT]; | |
| 45 bool is_open_; | |
| 46 DISALLOW_COPY_AND_ASSIGN(PowerProfilerHelperIA); | |
| 47 }; | |
| 48 | |
| 49 } // namespace content | |
| 50 | |
| 51 #endif // CONTENT_BROWSER_POWER_PROFILER_HELPER_IA_H_ | |
| OLD | NEW |