mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 17:10:23 +00:00
LibWeb+WebContent: Add EventLoopPlugin::quit() virtual
This allows you to customize breaking out of the system event loop.
This commit is contained in:
parent
a0d5724a58
commit
829186af7d
Notes:
sideshowbarker
2024-07-17 06:10:28 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/829186af7d
4 changed files with 9 additions and 1 deletions
|
@ -21,6 +21,7 @@ public:
|
|||
virtual void spin_until(Function<bool()> goal_condition) = 0;
|
||||
virtual void deferred_invoke(Function<void()>) = 0;
|
||||
virtual NonnullRefPtr<Timer> create_timer() = 0;
|
||||
virtual void quit() = 0;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -31,4 +31,9 @@ NonnullRefPtr<Timer> EventLoopPluginSerenity::create_timer()
|
|||
return TimerSerenity::create();
|
||||
}
|
||||
|
||||
void EventLoopPluginSerenity::quit()
|
||||
{
|
||||
Core::EventLoop::current().quit(0);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@ public:
|
|||
virtual void spin_until(Function<bool()> goal_condition) override;
|
||||
virtual void deferred_invoke(Function<void()>) override;
|
||||
virtual NonnullRefPtr<Timer> create_timer() override;
|
||||
virtual void quit() override;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include <LibWeb/Loader/ResourceLoader.h>
|
||||
#include <LibWeb/Painting/PaintableBox.h>
|
||||
#include <LibWeb/Painting/StackingContext.h>
|
||||
#include <LibWeb/Platform/EventLoopPlugin.h>
|
||||
#include <WebContent/ConnectionFromClient.h>
|
||||
#include <WebContent/PageHost.h>
|
||||
#include <WebContent/WebContentClientEndpoint.h>
|
||||
|
@ -45,7 +46,7 @@ ConnectionFromClient::ConnectionFromClient(NonnullOwnPtr<Core::Stream::LocalSock
|
|||
|
||||
void ConnectionFromClient::die()
|
||||
{
|
||||
Core::EventLoop::current().quit(0);
|
||||
Web::Platform::EventLoopPlugin::the().quit();
|
||||
}
|
||||
|
||||
Web::Page& ConnectionFromClient::page()
|
||||
|
|
Loading…
Reference in a new issue