Reland: Promises: Implement Promise<> handle with Then and Catch
Original patch https://crrev.com/c/1599620 MultiThreadedPromiseTest.CrossThreadThens had a race between the resolve on thread b and thread a posting a bunch of tasks including the quit closure which would sometimes arrive mid way through thread b posting eligible thens. Implements Then and Catch on top of AbstractPromise as well as ManualPromiseResolver<> which is needed for testing at this stage (PostTask doesn't yet return a promise). It's also necessary for promises to interface with old style callback based libraries which are extremely common in Chromium. Design: https://docs.google.com/document/d/1l12PAJgEtlrqTXKiw6mk2cR2jP7FAfCCDr-DGIdiC9w/edit TBR=fdoray@chromium.org, etiennep@chromium.org Bug: 906125 Change-Id: I95bbd0f1a709643cd4a813e378b625a91f2abe7a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1617769Reviewed-by:Alex Clarke <alexclarke@chromium.org> Commit-Queue: Alex Clarke <alexclarke@chromium.org> Cr-Commit-Position: refs/heads/master@{#661171}
Showing
base/task/promise/helpers.h
0 → 100644
This diff is collapsed.
This diff is collapsed.
base/task/promise/promise.h
0 → 100644
This diff is collapsed.
This diff is collapsed.
Please register or sign in to comment