ResourceLoader.h 437 B

12345678910111213141516171819202122
  1. #pragma once
  2. #include <AK/Function.h>
  3. #include <AK/URL.h>
  4. #include <LibCore/CObject.h>
  5. class ResourceLoader : public CObject {
  6. C_OBJECT(ResourceLoader)
  7. public:
  8. static ResourceLoader& the();
  9. void load(const URL&, Function<void(const ByteBuffer&)>);
  10. Function<void()> on_load_counter_change;
  11. int pending_loads() const { return m_pending_loads; }
  12. private:
  13. ResourceLoader() {}
  14. int m_pending_loads { 0 };
  15. };