Fix registration of PowerController for ThreadControllers.
The CL is fixing the issue where the IO-Thread was not receiving the power manager notifications. The observer list doesn't register observers without a sequence being set. void AddObserver(ObserverType* observer) { // TODO(fdoray): Change this to a DCHECK once all call sites have a // SequencedTaskRunnerHandle. if (!SequencedTaskRunnerHandle::IsSet()) return; Previously, these observers were not registered and notifications were not received. Currently, the thread controller bind to the current thread but has conditional code depending if the task runner is set. see: ThreadControllerWithMessagePumpImpl::BindToCurrentThread if (task_runner_) InitializeThreadTaskRunnerHandle(); The function InitializeThreadTaskRunnerHandle(...) is the place to make the link between the PowerMonitor and the Controller since a task_runner is required for power notifications. Bug: 1074332 Change-Id: If3e652e6516fdc3df4e3ea8ace909389d668e690 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2225627Reviewed-by:François Doray <fdoray@chromium.org> Reviewed-by:
Gabriel Charette <gab@chromium.org> Commit-Queue: Etienne Bergeron <etienneb@chromium.org> Cr-Commit-Position: refs/heads/master@{#774722}
Showing
Please register or sign in to comment