mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 21:59:07 +00:00
DevTools+LibJS+LibWeb: Change class_name to use StringView
This helps make the overall codebase consistent. `class_name()` in `Kernel` is always `StringView`, but not elsewhere. Additionally, this results in the `strlen` (which needs to be done when printing or other operations) always being computed at compile-time.
This commit is contained in:
parent
5b7a5b3c01
commit
a0367aa43b
Notes:
sideshowbarker
2024-07-17 17:08:50 +09:00
Author: https://github.com/ldm5180
Commit: a0367aa43b
Pull-request: https://github.com/SerenityOS/serenity/pull/13084
Reviewed-by: https://github.com/linusg
Reviewed-by: https://github.com/tomuta
17 changed files with 37 additions and 20 deletions
|
@ -9,6 +9,7 @@
|
|||
#include <AK/Format.h>
|
||||
#include <AK/Forward.h>
|
||||
#include <AK/Noncopyable.h>
|
||||
#include <AK/StringView.h>
|
||||
#include <LibJS/Forward.h>
|
||||
|
||||
namespace JS {
|
||||
|
@ -32,7 +33,7 @@ public:
|
|||
State state() const { return m_state; }
|
||||
void set_state(State state) { m_state = state; }
|
||||
|
||||
virtual const char* class_name() const = 0;
|
||||
virtual StringView class_name() const = 0;
|
||||
|
||||
class Visitor {
|
||||
public:
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
#include <AK/IntrusiveList.h>
|
||||
#include <AK/Platform.h>
|
||||
#include <AK/StringView.h>
|
||||
#include <AK/Types.h>
|
||||
#include <LibJS/Forward.h>
|
||||
#include <LibJS/Heap/Cell.h>
|
||||
|
@ -98,7 +99,7 @@ private:
|
|||
struct FreelistEntry final : public Cell {
|
||||
FreelistEntry* next { nullptr };
|
||||
|
||||
virtual const char* class_name() const override { return "FreelistEntry"; }
|
||||
virtual StringView class_name() const override { return "FreelistEntry"sv; }
|
||||
};
|
||||
|
||||
Cell* cell(size_t index)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue