Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix race between orientation sensor fallback and listener removal
This change fixes a DCHECK which can fire due to the internal state of the DeviceOrientationEventPump becoming invalid when a page removes its event listener before the failure to initialize the relative orientation sensor is received. This should've been handled by the existing code in DidStartIfPossible() however since DeviceSensorEntry::HandleSensorError() updates the sensor state to kNotInitialized the information that the event listener was removed and so the sensor should move into the kSuspended state after initialization was lost, resulting in the fallback sensor instead entering the kActive state. DidStartIfPossible() now checks the pump state, which will be set to kStopped, instead of the DeviceSensorEntry state. New unit tests have been added to exercise some of these "stopped while initializing" cases more carefully. Bug: 1409077 Change-Id: I3e7b6adf12dbb04e012486cef86d8b70a7f9378d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4190679 Auto-Submit: Reilly Grant <reillyg@chromium.org> Reviewed-by: Matt Reynolds <mattreynolds@chromium.org> Commit-Queue: Reilly Grant <reillyg@chromium.org> Cr-Commit-Position: refs/heads/main@{#1096396}
- Loading branch information
Showing
7 changed files
with
166 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.