1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-28 21:02:07 +00:00

Everywhere: Correctly report progress of downloads larger than 4GiB

This commit changes the variables used to represent the size and
progress of downloads from u32 to u64. This allows `pro` and
`Browser` to report the total size and progress of a download
correctly for downloads larger than 4GiB.
This commit is contained in:
Tim Ledbetter 2023-06-11 00:56:35 +01:00 committed by Andreas Kling
parent c5e0547377
commit 1a17e08f87
18 changed files with 40 additions and 42 deletions

View file

@ -24,13 +24,13 @@ RequestServerRequestAdapter::RequestServerRequestAdapter(NonnullRefPtr<Protocol:
strong_this->on_buffered_request_finish(success, total_size, response_headers, response_code, move(payload));
};
request->on_finish = [weak_this = make_weak_ptr()](bool success, u32 total_size) {
request->on_finish = [weak_this = make_weak_ptr()](bool success, u64 total_size) {
if (auto strong_this = weak_this.strong_ref())
if (strong_this->on_finish)
strong_this->on_finish(success, total_size);
};
request->on_progress = [weak_this = make_weak_ptr()](Optional<u32> total_size, u32 downloaded_size) {
request->on_progress = [weak_this = make_weak_ptr()](Optional<u64> total_size, u64 downloaded_size) {
if (auto strong_this = weak_this.strong_ref())
if (strong_this->on_progress)
strong_this->on_progress(total_size, downloaded_size);