mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-14 22:31:29 +03:00
24 lines
424 B
C++
24 lines
424 B
C++
|
#include <AK/HashMap.h>
|
||
|
#include <ProtocolServer/Protocol.h>
|
||
|
|
||
|
static HashMap<String, Protocol*>& all_protocols()
|
||
|
{
|
||
|
static HashMap<String, Protocol*> map;
|
||
|
return map;
|
||
|
}
|
||
|
|
||
|
Protocol* Protocol::find_by_name(const String& name)
|
||
|
{
|
||
|
return all_protocols().get(name).value_or(nullptr);
|
||
|
}
|
||
|
|
||
|
Protocol::Protocol(const String& name)
|
||
|
{
|
||
|
all_protocols().set(name, this);
|
||
|
}
|
||
|
|
||
|
Protocol::~Protocol()
|
||
|
{
|
||
|
ASSERT_NOT_REACHED();
|
||
|
}
|