diff --git a/Userland/Libraries/LibJS/Heap/Cell.h b/Userland/Libraries/LibJS/Heap/Cell.h index 6ad3cd1f914..6e0add01c08 100644 --- a/Userland/Libraries/LibJS/Heap/Cell.h +++ b/Userland/Libraries/LibJS/Heap/Cell.h @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -27,7 +28,7 @@ public: \ } \ friend class JS::Heap; -class Cell { +class Cell : public Weakable { AK_MAKE_NONCOPYABLE(Cell); AK_MAKE_NONMOVABLE(Cell); diff --git a/Userland/Libraries/LibJS/Heap/Heap.cpp b/Userland/Libraries/LibJS/Heap/Heap.cpp index 62d8e91e73e..35ddd247ba6 100644 --- a/Userland/Libraries/LibJS/Heap/Heap.cpp +++ b/Userland/Libraries/LibJS/Heap/Heap.cpp @@ -50,11 +50,7 @@ Heap::Heap(VM& vm) gc_perf_string_id = perf_register_string(gc_signpost_string.characters_without_null_termination(), gc_signpost_string.length()); #endif - if constexpr (HeapBlock::min_possible_cell_size <= 16) { - m_size_based_cell_allocators.append(make(16)); - } - static_assert(HeapBlock::min_possible_cell_size <= 24, "Heap Cell tracking uses too much data!"); - m_size_based_cell_allocators.append(make(32)); + static_assert(HeapBlock::min_possible_cell_size <= 32, "Heap Cell tracking uses too much data!"); m_size_based_cell_allocators.append(make(64)); m_size_based_cell_allocators.append(make(96)); m_size_based_cell_allocators.append(make(128)); diff --git a/Userland/Libraries/LibJS/Runtime/Realm.h b/Userland/Libraries/LibJS/Runtime/Realm.h index 5f0f54ca504..0186bab0443 100644 --- a/Userland/Libraries/LibJS/Runtime/Realm.h +++ b/Userland/Libraries/LibJS/Runtime/Realm.h @@ -20,9 +20,7 @@ namespace JS { // 9.3 Realms, https://tc39.es/ecma262/#realm-record -class Realm final - : public Cell - , public Weakable { +class Realm final : public Cell { JS_CELL(Realm, Cell); JS_DECLARE_ALLOCATOR(Realm); diff --git a/Userland/Libraries/LibJS/Runtime/Shape.h b/Userland/Libraries/LibJS/Runtime/Shape.h index fdfc8e1ef8c..dbbb66076cf 100644 --- a/Userland/Libraries/LibJS/Runtime/Shape.h +++ b/Userland/Libraries/LibJS/Runtime/Shape.h @@ -34,9 +34,7 @@ struct TransitionKey { } }; -class Shape final - : public Cell - , public Weakable { +class Shape final : public Cell { JS_CELL(Shape, Cell); JS_DECLARE_ALLOCATOR(Shape); diff --git a/Userland/Libraries/LibWeb/Bindings/PlatformObject.h b/Userland/Libraries/LibWeb/Bindings/PlatformObject.h index ddf4b6ac71b..30ad8afaace 100644 --- a/Userland/Libraries/LibWeb/Bindings/PlatformObject.h +++ b/Userland/Libraries/LibWeb/Bindings/PlatformObject.h @@ -22,9 +22,7 @@ namespace Web::Bindings { } // https://webidl.spec.whatwg.org/#dfn-platform-object -class PlatformObject - : public JS::Object - , public Weakable { +class PlatformObject : public JS::Object { JS_OBJECT(PlatformObject, JS::Object); public: diff --git a/Userland/Libraries/LibWeb/CSS/CSSStyleSheet.h b/Userland/Libraries/LibWeb/CSS/CSSStyleSheet.h index 71c78c39b15..11412d48f16 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSStyleSheet.h +++ b/Userland/Libraries/LibWeb/CSS/CSSStyleSheet.h @@ -25,9 +25,7 @@ struct CSSStyleSheetInit { bool disabled { false }; }; -class CSSStyleSheet final - : public StyleSheet - , public Weakable { +class CSSStyleSheet final : public StyleSheet { WEB_PLATFORM_OBJECT(CSSStyleSheet, StyleSheet); JS_DECLARE_ALLOCATOR(CSSStyleSheet); diff --git a/Userland/Libraries/LibWeb/HTML/BrowsingContext.h b/Userland/Libraries/LibWeb/HTML/BrowsingContext.h index aa61c6bcc2e..6f83bf91121 100644 --- a/Userland/Libraries/LibWeb/HTML/BrowsingContext.h +++ b/Userland/Libraries/LibWeb/HTML/BrowsingContext.h @@ -28,8 +28,7 @@ namespace Web::HTML { -class BrowsingContext final : public JS::Cell - , public Weakable { +class BrowsingContext final : public JS::Cell { JS_CELL(BrowsingContext, JS::Cell); JS_DECLARE_ALLOCATOR(BrowsingContext); diff --git a/Userland/Libraries/LibWeb/HTML/Navigable.h b/Userland/Libraries/LibWeb/HTML/Navigable.h index 810ba85f292..44a3b5d1ede 100644 --- a/Userland/Libraries/LibWeb/HTML/Navigable.h +++ b/Userland/Libraries/LibWeb/HTML/Navigable.h @@ -45,9 +45,7 @@ struct TargetSnapshotParams { }; // https://html.spec.whatwg.org/multipage/document-sequences.html#navigable -class Navigable - : public JS::Cell - , public Weakable { +class Navigable : public JS::Cell { JS_CELL(Navigable, JS::Cell); JS_DECLARE_ALLOCATOR(Navigable); diff --git a/Userland/Libraries/LibWeb/HTML/WorkerDebugConsoleClient.h b/Userland/Libraries/LibWeb/HTML/WorkerDebugConsoleClient.h index 0876f44f48f..88e1ca1720f 100644 --- a/Userland/Libraries/LibWeb/HTML/WorkerDebugConsoleClient.h +++ b/Userland/Libraries/LibWeb/HTML/WorkerDebugConsoleClient.h @@ -14,9 +14,7 @@ namespace Web::HTML { // NOTE: Temporary class to handle console messages from inside Workers -class WorkerDebugConsoleClient final - : public JS::ConsoleClient - , public Weakable { +class WorkerDebugConsoleClient final : public JS::ConsoleClient { JS_CELL(WorkerDebugConsoleClient, JS::ConsoleClient); JS_DECLARE_ALLOCATOR(WorkerDebugConsoleClient); diff --git a/Userland/Libraries/LibWeb/Layout/Node.h b/Userland/Libraries/LibWeb/Layout/Node.h index f2f27e50908..608584d80c5 100644 --- a/Userland/Libraries/LibWeb/Layout/Node.h +++ b/Userland/Libraries/LibWeb/Layout/Node.h @@ -37,8 +37,7 @@ enum class LayoutMode { class Node : public JS::Cell - , public TreeNode - , public Weakable { + , public TreeNode { JS_CELL(Node, JS::Cell); public: diff --git a/Userland/Libraries/LibWeb/Page/Page.cpp b/Userland/Libraries/LibWeb/Page/Page.cpp index c369a568922..f45960b7c67 100644 --- a/Userland/Libraries/LibWeb/Page/Page.cpp +++ b/Userland/Libraries/LibWeb/Page/Page.cpp @@ -55,7 +55,7 @@ HTML::Navigable& Page::focused_navigable() void Page::set_focused_navigable(Badge, HTML::Navigable& navigable) { - m_focused_navigable = navigable.make_weak_ptr(); + m_focused_navigable = navigable; } void Page::load(URL::URL const& url) diff --git a/Userland/Services/WebContent/WebContentConsoleClient.h b/Userland/Services/WebContent/WebContentConsoleClient.h index 5b3e8712954..a28b3f7ccdc 100644 --- a/Userland/Services/WebContent/WebContentConsoleClient.h +++ b/Userland/Services/WebContent/WebContentConsoleClient.h @@ -18,8 +18,7 @@ namespace WebContent { -class WebContentConsoleClient final : public JS::ConsoleClient - , public Weakable { +class WebContentConsoleClient final : public JS::ConsoleClient { JS_CELL(WebContentConsoleClient, JS::ConsoleClient); JS_DECLARE_ALLOCATOR(WebContentConsoleClient);