mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 12:48:10 +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:
parent
c5e0547377
commit
1a17e08f87
18 changed files with 40 additions and 42 deletions
|
@ -88,7 +88,7 @@ void Request::set_should_buffer_all_input(bool value)
|
|||
m_internal_buffered_data->response_code = move(response_code);
|
||||
};
|
||||
|
||||
on_finish = [this](auto success, u32 total_size) {
|
||||
on_finish = [this](auto success, auto total_size) {
|
||||
auto output_buffer = ByteBuffer::create_uninitialized(m_internal_buffered_data->payload_stream.used_buffer_size()).release_value_but_fixme_should_propagate_errors();
|
||||
m_internal_buffered_data->payload_stream.read_until_filled(output_buffer).release_value_but_fixme_should_propagate_errors();
|
||||
on_buffered_request_finish(
|
||||
|
@ -102,7 +102,7 @@ void Request::set_should_buffer_all_input(bool value)
|
|||
stream_into(m_internal_buffered_data->payload_stream);
|
||||
}
|
||||
|
||||
void Request::did_finish(Badge<RequestClient>, bool success, u32 total_size)
|
||||
void Request::did_finish(Badge<RequestClient>, bool success, u64 total_size)
|
||||
{
|
||||
if (!on_finish)
|
||||
return;
|
||||
|
@ -110,7 +110,7 @@ void Request::did_finish(Badge<RequestClient>, bool success, u32 total_size)
|
|||
on_finish(success, total_size);
|
||||
}
|
||||
|
||||
void Request::did_progress(Badge<RequestClient>, Optional<u32> total_size, u32 downloaded_size)
|
||||
void Request::did_progress(Badge<RequestClient>, Optional<u64> total_size, u64 downloaded_size)
|
||||
{
|
||||
if (on_progress)
|
||||
on_progress(total_size, downloaded_size);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue