Subscription lifetime management in TabLifecycleUnitSource is improved.
TabLifecycleUnitSource checked for an instance of PageSignalReceiver both when subscribing and unsubscribing to/from it. The PageSignalReceiver::GetInstance() called its static IsEnabled() method first; the latter returned false if content::ServiceManagerConnection::GetForProcess() returned nullptr. Normally, PageSignalReceiver is a static singleton with NoDestructor wrapper, and TabLifecycleUnitSource is owned by the browser process, so the above chain might result in that TabLifecycleUnitSource would not unsubscribe because ServiceManagerConnection for process was already destroyed. The bug is subtle and fires sporadically in random unit tests. R=haraken@chromium.org Change-Id: I34827b3a598f39f38a05c8d68cb3953009454aac Reviewed-on: https://chromium-review.googlesource.com/1180216Reviewed-by:Kentaro Hara <haraken@chromium.org> Commit-Queue: Alexander Dunaev <voodoo@yandex-team.ru> Cr-Commit-Position: refs/heads/master@{#584377}
Showing
Please register or sign in to comment