mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 05:39:11 +00:00
LibWeb: Implement AbstractWorker
This effectively implements Worker.onerror, and in future SharedWorker.onerror.
This commit is contained in:
parent
20f68106a7
commit
3440d2b843
Notes:
github-actions[bot]
2024-09-02 11:12:17 +00:00
Author: https://github.com/jamierocks
Commit: 3440d2b843
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1239
6 changed files with 65 additions and 1 deletions
|
@ -10,6 +10,7 @@
|
|||
#include <LibURL/Parser.h>
|
||||
#include <LibWeb/Bindings/MainThreadVM.h>
|
||||
#include <LibWeb/Forward.h>
|
||||
#include <LibWeb/HTML/AbstractWorker.h>
|
||||
#include <LibWeb/HTML/MessageEvent.h>
|
||||
#include <LibWeb/HTML/MessagePort.h>
|
||||
#include <LibWeb/HTML/Scripting/ClassicScript.h>
|
||||
|
@ -27,7 +28,9 @@
|
|||
namespace Web::HTML {
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/workers.html#dedicated-workers-and-the-worker-interface
|
||||
class Worker : public DOM::EventTarget {
|
||||
class Worker
|
||||
: public DOM::EventTarget
|
||||
, public HTML::AbstractWorker {
|
||||
WEB_PLATFORM_OBJECT(Worker, DOM::EventTarget);
|
||||
JS_DECLARE_ALLOCATOR(Worker);
|
||||
|
||||
|
@ -57,6 +60,9 @@ public:
|
|||
protected:
|
||||
Worker(String const&, WorkerOptions const&, DOM::Document&);
|
||||
|
||||
// ^AbstractWorker
|
||||
virtual DOM::EventTarget& this_event_target() override { return *this; }
|
||||
|
||||
private:
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue