commit | 6dffb6a8a2c1953ee276c1eba9fb05c7b0ecebdb | [log] [tgz] |
---|---|---|
author | Daniel Cheng <dcheng@chromium.org> | Fri Dec 01 18:57:49 2023 |
committer | Chromium LUCI CQ <chromium-scoped@luci-project-accounts.iam.gserviceaccount.com> | Fri Dec 01 18:57:49 2023 |
tree | 2c2439ea312826d2923e943ee7a8a12c563b4f64 | |
parent | 53f78d1a9894dcdffe5db6fd319771de3262d8e6 [diff] |
Remove base::Passed() use in ChromeDownloadManagerDelegate. ShouldCompleteDownload(..., base::OnceClosure callback) is a "potentially async" API: when it completes synchronously, it returns true and never invokes `callback`; otherwise, it invokes `callback` when the download should be completed. However, if a user of `ShouldCompleteDownload()` wants to always signal the result via a callback, this becomes tricky with a OnceCallback, since `callback` is consumed even on synchronous completion. `base::Passed()` was a legacy hack to support move-only types with repeating callbacks; modern code should use `base::SplitOnceCalblack()`, which was specifically implemented to support this style of API. Bug: 1326449 Change-Id: I34bed8699290b77ea0c97a14921c06d6c93f9209 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5078797 Commit-Queue: Daniel Cheng <dcheng@chromium.org> Reviewed-by: Xinghui Lu <xinghuilu@chromium.org> Cr-Commit-Position: refs/heads/main@{#1232075}
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.
To check out the source code locally, don't use git clone
! Instead, follow the instructions on how to get the code.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .
For historical reasons, there are some small top level directories. Now the guidance is that new top level directories are for product (e.g. Chrome, Android WebView, Ash). Even if these products have multiple executables, the code should be in subdirectories of the product.
If you found a bug, please file it at https://crbug.com/new.