mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-08 17:19:13 +00:00
LibDevTools+LibWebView: Port DevTools to String
This commit is contained in:
parent
9879ac0893
commit
4791ec35bf
Notes:
github-actions[bot]
2025-02-21 00:29:06 +00:00
Author: https://github.com/trflynn89
Commit: 4791ec35bf
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3631
Reviewed-by: https://github.com/awesomekling ✅
35 changed files with 99 additions and 98 deletions
|
@ -10,13 +10,14 @@
|
|||
#include <AK/HashMap.h>
|
||||
#include <AK/NonnullOwnPtr.h>
|
||||
#include <AK/NonnullRefPtr.h>
|
||||
#include <AK/String.h>
|
||||
#include <LibCore/Socket.h>
|
||||
#include <LibDevTools/Actors/RootActor.h>
|
||||
#include <LibDevTools/Forward.h>
|
||||
|
||||
namespace DevTools {
|
||||
|
||||
using ActorRegistry = HashMap<ByteString, NonnullRefPtr<Actor>>;
|
||||
using ActorRegistry = HashMap<String, NonnullRefPtr<Actor>>;
|
||||
|
||||
class DevToolsServer {
|
||||
public:
|
||||
|
@ -30,12 +31,12 @@ public:
|
|||
template<typename ActorType, typename... Args>
|
||||
ActorType& register_actor(Args&&... args)
|
||||
{
|
||||
ByteString name;
|
||||
String name;
|
||||
|
||||
if constexpr (IsSame<ActorType, RootActor>) {
|
||||
name = ActorType::base_name;
|
||||
name = String::from_utf8_without_validation(ActorType::base_name.bytes());
|
||||
} else {
|
||||
name = ByteString::formatted("server{}-{}{}", m_server_id, ActorType::base_name, m_actor_count);
|
||||
name = MUST(String::formatted("server{}-{}{}", m_server_id, ActorType::base_name, m_actor_count));
|
||||
}
|
||||
|
||||
auto actor = ActorType::create(*this, name, forward<Args>(args)...);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue