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

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: Address code review nit 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 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_;
« 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