Index: cc/scheduler/scheduler.h |
diff --git a/cc/scheduler/scheduler.h b/cc/scheduler/scheduler.h |
index 70522eb218621d629dc4bcf14f445c50c97397c6..19c15db3c7d3a5845d28bbfff7ee967a05679200 100644 |
--- a/cc/scheduler/scheduler.h |
+++ b/cc/scheduler/scheduler.h |
@@ -11,6 +11,7 @@ |
#include "base/basictypes.h" |
#include "base/cancelable_callback.h" |
#include "base/memory/scoped_ptr.h" |
+#include "base/power_monitor/power_observer.h" |
#include "base/time/time.h" |
#include "cc/base/cc_export.h" |
#include "cc/output/begin_frame_args.h" |
@@ -51,7 +52,7 @@ class SchedulerClient { |
virtual ~SchedulerClient() {} |
}; |
-class CC_EXPORT Scheduler { |
+class CC_EXPORT Scheduler : public base::PowerObserver { |
public: |
static scoped_ptr<Scheduler> Create( |
SchedulerClient* client, |
@@ -64,6 +65,9 @@ class CC_EXPORT Scheduler { |
virtual ~Scheduler(); |
+ // base::PowerObserver method. |
+ virtual void OnPowerStateChange(bool on_battery_power) OVERRIDE; |
+ |
const SchedulerSettings& settings() const { return settings_; } |
void CommitVSyncParameters(base::TimeTicks timebase, |
@@ -200,6 +204,8 @@ class CC_EXPORT Scheduler { |
bool inside_process_scheduled_actions_; |
SchedulerStateMachine::Action inside_action_; |
+ bool on_battery_power_; |
brianderson
2014/09/12 22:05:27
Can you make sure this flag is included in the tra
sunnyps
2014/09/15 21:52:48
Done.
|
+ |
base::TimeDelta VSyncInterval() { return vsync_interval_; } |
private: |
@@ -220,10 +226,13 @@ class CC_EXPORT Scheduler { |
void SetupSyntheticBeginFrames(); |
void BeginRetroFrame(); |
void BeginUnthrottledFrame(); |
+ bool ShouldPostBeginImplFrameDeadline() const; |
void BeginImplFrame(const BeginFrameArgs& args); |
void OnBeginImplFrameDeadline(); |
void PollForAnticipatedDrawTriggers(); |
void PollToAdvanceCommitState(); |
+ void SetupPowerMonitoring(); |
+ void TeardownPowerMonitoring(); |
base::TimeDelta EstimatedParentDrawTime() { |
return estimated_parent_draw_time_; |