commit | a07a3ab86405538d2831fcd16e349b4ffbcae252 | [log] [tgz] |
---|---|---|
author | Trent Apted <tapted@chromium.org> | Sun Feb 03 23:14:44 2019 |
committer | Trent Apted <tapted@chromium.org> | Sun Feb 03 23:14:44 2019 |
tree | ca171288a57977ca2d5e3bde0ef9ab66502d0020 | |
parent | 2fd38a1508b64ded5936b08fb754dfe32bdfd6d6 [diff] |
[merge-m73] Do not bind a raw pointer in AppShortcutManager callbacks. UpdateShortcutsForAllApps() spawns disk IO tasks to update shortcuts, then executes a callback on the calling thread when they're all complete. It's possible for a browser shutdown or profile deletion to occur in the meantime, in which case we can no longer write to the profile preferences. Updates will happen again on the next browser startup if the profile still exists then. The initial call to UpdateShortcutsForAllApps() is also delayed. To fix, call these via the WeakPtr that already exists. AppShortcutManager is a [Profile]KeyedService so will always be destroyed before the Profile* it's keyed to, nerfing callbacks that have bound the WeakPtr. Note UpdateShortcutsForAllApps() writes to user home folders, so can't be tested on the bots directly. (Things it calls are tested via mocks bound to WebAppShortcutCreator). TBR=tapted@chromium.org (cherry picked from commit 0fce8e3240f217c0ff3cd446878a6d2525b31dd1) Bug: 925194 Change-Id: If05c45178cda5e7b0322d30c155b79feecddf478 Reviewed-on: https://chromium-review.googlesource.com/c/1442035 Reviewed-by: ccameron <ccameron@chromium.org> Commit-Queue: Trent Apted <tapted@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#627672} Reviewed-on: https://chromium-review.googlesource.com/c/1451476 Reviewed-by: Trent Apted <tapted@chromium.org> Cr-Commit-Position: refs/branch-heads/3683@{#150} Cr-Branched-From: e51029943e0a38dd794b73caaf6373d5496ae783-refs/heads/master@{#625896}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .