mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
ProtocolServer: Implement and handle download progress
Also updates `pro` to display download progress and speed on stderr
This commit is contained in:
committed by
Andreas Kling
parent
c6825a96c7
commit
06cf9d3fb7
@@ -78,6 +78,16 @@ void NetworkJob::did_fail(Error error)
|
||||
shutdown();
|
||||
}
|
||||
|
||||
void NetworkJob::did_progress(Optional<u32> total_size, u32 downloaded)
|
||||
{
|
||||
// NOTE: We protect ourselves here, since the callback may otherwise
|
||||
// trigger destruction of this job somehow.
|
||||
NonnullRefPtr<NetworkJob> protector(*this);
|
||||
|
||||
if (on_progress)
|
||||
on_progress(total_size, downloaded);
|
||||
}
|
||||
|
||||
const char* to_string(NetworkJob::Error error)
|
||||
{
|
||||
switch (error) {
|
||||
|
||||
Reference in New Issue
Block a user