mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 20:22:45 +00:00 
			
		
		
		
	LibWeb: Add ResourceLoader::load_sync()
This function creates a nested event loop and runs a load() operation inside it, returning only once the load has either succeeded or failed. This will be used to implement blocking loads (ew!)
This commit is contained in:
		
							parent
							
								
									eeec1c1293
								
							
						
					
					
						commit
						18d45d1082
					
				
					 2 changed files with 20 additions and 0 deletions
				
			
		|  | @ -42,6 +42,7 @@ public: | |||
|     static ResourceLoader& the(); | ||||
| 
 | ||||
|     void load(const URL&, Function<void(const ByteBuffer&)> success_callback, Function<void(const String&)> error_callback = nullptr); | ||||
|     void load_sync(const URL&, Function<void(const ByteBuffer&)> success_callback, Function<void(const String&)> error_callback = nullptr); | ||||
| 
 | ||||
|     Function<void()> on_load_counter_change; | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling