Added here: https://chromium.googlesource.com/chromium/src/+/19019f27a62f561909f0ec733510bacbd74b374c%5E%21/#F2 :
+ if (!focus_controller_) {
+ focus_controller_->RemoveObserver(this);
+ focus_controller_.reset();
+ }
if focus_controller_ is NULL, then we'll enter the if and crash. (Since this seems to not happen, focus_controller_ seems to always been set.) The intention, and the behavior before that change, is `if (focus_controller_)` without the `!`.
So the RemoveObserver() never happens. Since nobody notices this not happening, maybe this code isn't needed at all?
(found by PVS-Studio in the blocking bug)
Comment 1 by bugdroid1@chromium.org
, Feb 12 2018