Fix a DCHECK in UpdateClientImpl destructor
UpdateClientImpl DCHECKs that it's destructed only if list of pending tasks is empty. Tasks have a callback bound to a update client reference, and the UpdateClient keeps a references to pending update tasks, so this should generally be true, but TaskUpdate invokes the callback by posting it to a task runner, which moves the callback (and a UpdateClientImpl reference) ownership to the task runner itself. If Chrome shutsdown while the callback task is scheduled on the task runner, the UpdateClientImpl will be deleted with the callback during task runner tear-down, before the callback is run. Also, fixes a task instance was referencing a callback bound to unretained UpdateClientImpl, thus not keeping UpdateClient alive. BUG=1079241 Change-Id: I6f6c81c9011ede03806362fd5cf52a3f36b36cf8 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2205326Reviewed-by:Sorin Jianu <sorin@chromium.org> Commit-Queue: Toni Baržić <tbarzic@chromium.org> Cr-Commit-Position: refs/heads/master@{#769944}
Showing
Please register or sign in to comment