[Suggested files] Add a second weak pointer factory
The Drive QuickAccess provider makes API calls to the backend, and each API call should first cancel any in-flight calls. Currently we do that by binding the call to a weak pointer, and invalidating all weak pointers before making the next API call. But this causes a bug: other parts of the provider rely on the same weak pointer factory for unrelated callbacks, which then get erroneously cancelled. This CL adds a second weak pointer factory, and splits the work between the two. This lets the API calls be cancelled independent of all other calls. Note I can only find one place in the codebase using two factories [1], but I can't think of an better fix here. [1] https://cs.chromium.org/chromium/src/chrome/browser/ui/browser.h?l=1209 Bug: 1034842 Change-Id: I034c0fdaff580801bb147cbd1cba24d499bf0002 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2246002Reviewed-by:Rachel Wong <wrong@chromium.org> Commit-Queue: Tony Yeoman <tby@chromium.org> Cr-Commit-Position: refs/heads/master@{#779186}
Showing
Please register or sign in to comment