OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 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 CHROME_BROWSER_DEVTOOLS_DEVTOOLS_POWER_PROFILER_HOST_H_ |
| 6 #define CHROME_BROWSER_DEVTOOLS_DEVTOOLS_POWER_PROFILER_HOST_H_ |
| 7 |
| 8 #include "base/basictypes.h" |
| 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/weak_ptr.h" |
| 11 #include "base/values.h" |
| 12 #include "chrome/browser/devtools/devtools_window.h" |
| 13 #include "content/public/browser/power_profiler_observer.h" |
| 14 |
| 15 class DevToolsWindow; |
| 16 |
| 17 // A class used to monitor the power usage and tell profiler the power data |
| 18 class DevToolsPowerProfilerHost : public content::PowerProfilerObserver { |
| 19 public: |
| 20 explicit DevToolsPowerProfilerHost(const base::WeakPtr<DevToolsWindow>&); |
| 21 ~DevToolsPowerProfilerHost() {} |
| 22 virtual void Send(content::PowerEvent*) OVERRIDE; |
| 23 |
| 24 private: |
| 25 void SendWrapper(const std::string& message); |
| 26 base::Time convertMonotonicTimeToWallTime(base::TimeTicks&); |
| 27 void convertPowerValueToJSONObject(base::DictionaryValue*, |
| 28 content::PowerEvent*); |
| 29 base::WeakPtr<DevToolsWindow> frontend_host_; |
| 30 DISALLOW_COPY_AND_ASSIGN(DevToolsPowerProfilerHost); |
| 31 }; |
| 32 |
| 33 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_POWER_PROFILER_HOST_H_ |
OLD | NEW |