mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 17:02:45 +00:00 
			
		
		
		
	LibWeb+WebContent: Add abstraction layer for event loop and timers
Instead of using Core::EventLoop and Core::Timer directly, LibWeb now goes through a Web::Platform abstraction layer instead. This will allow us to plug in Qt's event loop (and QTimer) over in Ladybird, to avoid having to deal with multiple event loops.
This commit is contained in:
		
							parent
							
								
									7e5a8bd4b0
								
							
						
					
					
						commit
						9567e211e7
					
				
					 28 changed files with 365 additions and 42 deletions
				
			
		
							
								
								
									
										28
									
								
								Userland/Libraries/LibWeb/Platform/EventLoopPlugin.cpp
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								Userland/Libraries/LibWeb/Platform/EventLoopPlugin.cpp
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,28 @@ | |||
| /*
 | ||||
|  * Copyright (c) 2022, Andreas Kling <kling@serenityos.org> | ||||
|  * | ||||
|  * SPDX-License-Identifier: BSD-2-Clause | ||||
|  */ | ||||
| 
 | ||||
| #include <AK/Function.h> | ||||
| #include <LibWeb/Platform/EventLoopPlugin.h> | ||||
| 
 | ||||
| namespace Web::Platform { | ||||
| 
 | ||||
| EventLoopPlugin* s_the; | ||||
| 
 | ||||
| EventLoopPlugin& EventLoopPlugin::the() | ||||
| { | ||||
|     VERIFY(s_the); | ||||
|     return *s_the; | ||||
| } | ||||
| 
 | ||||
| void EventLoopPlugin::install(EventLoopPlugin& plugin) | ||||
| { | ||||
|     VERIFY(!s_the); | ||||
|     s_the = &plugin; | ||||
| } | ||||
| 
 | ||||
| EventLoopPlugin::~EventLoopPlugin() = default; | ||||
| 
 | ||||
| } | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling