Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 class Platform(object): | 5 class Platform(object): |
|
nduca
2012/12/07 18:12:06
By subclassing the platform, you override the doc
bulach
2012/12/07 20:45:53
ahn, thanks! I didn't know the the docstrings were
| |
| 6 """The platform that the target browser is running on. | 6 """The platform that the target browser is running on. |
| 7 | 7 |
| 8 Provides a limited interface to obtain stats from the platform itself, where | 8 Provides a limited interface to interact with the platform itself, where |
| 9 possible. | 9 possible. It's important to note that platforms may not provide a specific |
| 10 API, so check with IsFooBar() for availability. | |
| 10 """ | 11 """ |
| 12 def IsRawDisplayFrameRateSupported(self): | |
| 13 """Platforms may be able to collect GL surface stats.""" | |
| 14 return False | |
| 11 | 15 |
| 12 def GetSurfaceCollector(self, trace_tag): | 16 def StartRawDisplayFrameRate(self, trace_tag): |
|
nduca
2012/12/07 18:12:06
Not clear whether you need a stop.
bulach
2012/12/07 20:45:53
Done.
| |
| 13 """Platforms may be able to collect GL surface stats.""" | 17 """Start collecting GL surface stats.""" |
| 14 class StubSurfaceCollector(object): | 18 raise NotImplementedError() |
| 15 def __init__(self, trace_tag): | |
| 16 pass | |
| 17 def __enter__(self): | |
| 18 pass | |
| 19 def __exit__(self, *args): | |
| 20 pass | |
| 21 | 19 |
| 22 return StubSurfaceCollector(trace_tag) | 20 def GetRawDisplayFrameRate(self): |
| 21 """Prints GL surface stats.""" | |
|
nduca
2012/12/07 18:12:06
Not clear from the API if this can be called multi
bulach
2012/12/07 20:45:53
Done.
| |
| 22 raise NotImplementedError() | |
| 23 | |
| 24 def SetFullPerformanceModeEnabled(self, enabled): | |
| 25 """Platforms may tweak their CPU governor, system status, etc.""" | |
|
nduca
2012/12/07 18:12:06
You might want to improve this docstring. Somethi
bulach
2012/12/07 20:45:53
Done.
| |
| 26 pass | |
| 27 | |
| 28 def CanMonitorThermalThrottling(self): | |
|
nduca
2012/12/07 18:12:06
Again, more docstring is good
Some fan-less compu
bulach
2012/12/07 20:45:53
Done.
| |
| 29 """Platforms may be able to detect thermal throttling.""" | |
| 30 return False | |
| 31 | |
| 32 def StartMonitoringThermalThrottling(self): | |
| 33 """Start monitoring thermal throttling.""" | |
| 34 raise NotImplementedError() | |
| 35 | |
| 36 def StopMonitoringThermalThrottling(self): | |
|
nduca
2012/12/07 18:12:06
Why start and stop? Why not just IsDeviceThermally
bulach
2012/12/07 20:45:53
Done.
| |
| 37 """Stops monitoring thermal throttling.""" | |
| 38 raise NotImplementedError() | |
| OLD | NEW |