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

Unified Diff: ui/display/chromeos/display_configurator.cc

Issue 2154743003: Fix queuing of display power state change requests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix typo Created 4 years, 5 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 | ui/display/chromeos/display_configurator_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/display/chromeos/display_configurator.cc
diff --git a/ui/display/chromeos/display_configurator.cc b/ui/display/chromeos/display_configurator.cc
index eb1c0a4a8c4fe385b3dca2a83ed0493d7287216b..c12f4073e5d0a779fb1c24ea5d52de72bb98f982 100644
--- a/ui/display/chromeos/display_configurator.cc
+++ b/ui/display/chromeos/display_configurator.cc
@@ -844,7 +844,13 @@ void DisplayConfigurator::SetDisplayPowerInternal(
chromeos::DisplayPowerState power_state,
int flags,
const ConfigurationCallback& callback) {
+ // Only skip if the current power state is the same and the latest requested
+ // power state is the same. If |pending_power_state_ != current_power_state_|
+ // then there is a current task pending or the last configuration failed. In
+ // either case request a new configuration to make sure the state is
+ // consistent with the expectations.
if (power_state == current_power_state_ &&
+ power_state == pending_power_state_ &&
!(flags & kSetDisplayPowerForceProbe)) {
callback.Run(true);
return;
« no previous file with comments | « no previous file | ui/display/chromeos/display_configurator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698