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

Unified Diff: cc/scheduler/scheduler.h

Issue 554973002: Disable scheduler deadline task on battery power in Windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: After rebase Created 6 years, 3 months 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
« no previous file with comments | « no previous file | cc/scheduler/scheduler.cc » ('j') | cc/scheduler/scheduler.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/scheduler/scheduler.h
diff --git a/cc/scheduler/scheduler.h b/cc/scheduler/scheduler.h
index 97b17b7283aaf4e357be4fd8e5726298f80c63cf..53d6b8ac569e13101b9136ebd86d415edd092a2b 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,
@@ -198,6 +202,8 @@ class CC_EXPORT Scheduler {
bool inside_process_scheduled_actions_;
SchedulerStateMachine::Action inside_action_;
+ bool on_battery_power_;
+
private:
base::TimeTicks AdjustedBeginImplFrameDeadline(
const BeginFrameArgs& args,
@@ -216,10 +222,13 @@ class CC_EXPORT Scheduler {
void SetupSyntheticBeginFrames();
void BeginRetroFrame();
void BeginUnthrottledFrame();
+ bool ShouldPostBeginImplFrameDeadline();
void BeginImplFrame(const BeginFrameArgs& args);
void OnBeginImplFrameDeadline();
void PollForAnticipatedDrawTriggers();
void PollToAdvanceCommitState();
+ void SetupPowerMonitoring();
+ void TeardownPowerMonitoring();
base::TimeDelta VSyncInterval() { return vsync_interval_; }
« no previous file with comments | « no previous file | cc/scheduler/scheduler.cc » ('j') | cc/scheduler/scheduler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698