mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-16 23:31:55 +00:00
LibJS+LibWeb: Make HTML::Script GC-allocated
This allows the garbage collector to keep HTML::Script objects alive and fixes a bug where a HTMLScriptElement could get GC'd while its code was executing.
This commit is contained in:
parent
00c8f07192
commit
8f9ed415a0
Notes:
sideshowbarker
2024-07-17 07:23:32 +09:00
Author: https://github.com/awesomekling
Commit: 8f9ed415a0
Pull-request: https://github.com/SerenityOS/serenity/pull/14816
Reviewed-by: https://github.com/ADKaster
Reviewed-by: https://github.com/linusg ✅
6 changed files with 35 additions and 12 deletions
|
@ -6,16 +6,18 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/RefCounted.h>
|
||||
#include <AK/URL.h>
|
||||
#include <LibJS/Heap/Cell.h>
|
||||
#include <LibWeb/Forward.h>
|
||||
|
||||
namespace Web::HTML {
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/webappapis.html#concept-script
|
||||
class Script : public RefCounted<Script> {
|
||||
class Script : public JS::Cell {
|
||||
JS_CELL(Script, JS::Cell);
|
||||
|
||||
public:
|
||||
virtual ~Script();
|
||||
virtual ~Script() override;
|
||||
|
||||
AK::URL const& base_url() const { return m_base_url; }
|
||||
String const& filename() const { return m_filename; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue