mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 22:17:42 +00:00
LibHTML: Decrement the pending loads counter when a load finishes
This ensures that the browser statusbar shows the correct number of still pending resource loads.
This commit is contained in:
parent
7ef51293c7
commit
e691d16f1c
1 changed files with 4 additions and 1 deletions
|
@ -37,7 +37,10 @@ void ResourceLoader::load(const URL& url, Function<void(const ByteBuffer&)> call
|
||||||
|
|
||||||
if (url.protocol() == "http") {
|
if (url.protocol() == "http") {
|
||||||
auto download = protocol_client().start_download(url.to_string());
|
auto download = protocol_client().start_download(url.to_string());
|
||||||
download->on_finish = [callback = move(callback)](bool success, const ByteBuffer& payload, auto) {
|
download->on_finish = [this, callback = move(callback)](bool success, const ByteBuffer& payload, auto) {
|
||||||
|
--m_pending_loads;
|
||||||
|
if (on_load_counter_change)
|
||||||
|
on_load_counter_change();
|
||||||
if (!success) {
|
if (!success) {
|
||||||
dbg() << "HTTP load failed!";
|
dbg() << "HTTP load failed!";
|
||||||
ASSERT_NOT_REACHED();
|
ASSERT_NOT_REACHED();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue