[Cronet] Extend the lifetime of |RequestFinishedInfo|. Cronet users have expressed a desire to correlate information from the |RequestFinishedInfoListener| and the |UrlRequestCallback|. With the current |RequestFinishedInfo| ownership, this is very awkward to do -- the |RequestFinishedInfo| only lives for the duration of |RequestFinishedInfoListener.OnRequestFinished()|, which may be run before or after the |UrlRequestCallback| methods |OnSucceeded()|, |OnFailed()|, and |OnCanceled()|, depending on the |RequestFinishedListener| executor and ordering of thread execution. The |UrlResponseInfo| and |Error| objects are already owned by the |UrlRequest|, so making the |RequestFinishedInfo| also owned by the |UrlRequest| makes sense. However, since the app is allowed to destroy the |UrlRequest| after the |OnSucceeded()|, |OnFailed()|, and |OnCanceled()| methods, which may be run before |OnRequestFinished()|, we should also ensure that the |RequestFinishedInfo| is valid for the duration of each |RequestFinishedInfo| call so that app developers can avoid debugging use-after-free races. We can accomplish both by sharing ownership between the |UrlRequest| and the |RequestFinishedInfoListener| runner code. Bug: 879208 Change-Id: I88cf28b59e162b2550ed7a1f8f521bcf78cfc367 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1584890 Reviewed-by: Misha Efimov <mef@chromium.org> Reviewed-by: Paul Jensen <pauljensen@chromium.org> Commit-Queue: Caleb Raitto <caraitto@chromium.org> Cr-Commit-Position: refs/heads/master@{#654314}
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 .