ladybird/Libraries/LibHTML/ResourceLoader.h
Andreas Kling 06113b4ffe LibHTML+Browser: Show the number of pending resource loads
For now this is simply a counter+hook exposed by ResourceLoader and
shown in the Browser status bar.

This is not very nuanced, and it would be nice to expose more info so
we could eventually do something like a progress bar.
2019-10-10 22:07:08 +02:00

22 lines
437 B
C++

#pragma once
#include <AK/Function.h>
#include <AK/URL.h>
#include <LibCore/CObject.h>
class ResourceLoader : public CObject {
C_OBJECT(ResourceLoader)
public:
static ResourceLoader& the();
void load(const URL&, Function<void(const ByteBuffer&)>);
Function<void()> on_load_counter_change;
int pending_loads() const { return m_pending_loads; }
private:
ResourceLoader() {}
int m_pending_loads { 0 };
};