diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-11-25 11:47:25 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-11-25 11:47:25 +0100 |
commit | e691d16f1c392671373eff489625760d2ef17de8 (patch) | |
tree | 8b7b42e211fb339a0479349109494bb30a0395fc /Libraries | |
parent | 7ef51293c7924fd50e624c3ce39cfe7662eb6683 (diff) | |
download | serenity-e691d16f1c392671373eff489625760d2ef17de8.zip |
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.
Diffstat (limited to 'Libraries')
-rw-r--r-- | Libraries/LibHTML/ResourceLoader.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Libraries/LibHTML/ResourceLoader.cpp b/Libraries/LibHTML/ResourceLoader.cpp index 24821ee3ff..12084d2dc5 100644 --- a/Libraries/LibHTML/ResourceLoader.cpp +++ b/Libraries/LibHTML/ResourceLoader.cpp @@ -37,7 +37,10 @@ void ResourceLoader::load(const URL& url, Function<void(const ByteBuffer&)> call if (url.protocol() == "http") { 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) { dbg() << "HTTP load failed!"; ASSERT_NOT_REACHED(); |