mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-30 07:42:07 +00:00 
			
		
		
		
	 06113b4ffe
			
		
	
	
		06113b4ffe
		
	
	
	
	
		
			
			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.
		
			
				
	
	
		
			22 lines
		
	
	
	
		
			437 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			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 };
 | |
| };
 |