mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
IPCCompiler: Use string hashes for IPC endpoint magic
This patch removes the IPC endpoint numbers that needed to be specified in the IPC files. Since the string hash is a (hopefully) collision free number that depends on the name of the endpoint, we now use that instead. :^)
This commit is contained in:
parent
f89c60664c
commit
59218007a3
Notes:
sideshowbarker
2024-07-18 19:08:45 +09:00
Author: https://github.com/sin-ack Commit: https://github.com/SerenityOS/serenity/commit/59218007a30 Pull-request: https://github.com/SerenityOS/serenity/pull/6627 Reviewed-by: https://github.com/awesomekling
25 changed files with 25 additions and 29 deletions
|
@ -1,4 +1,4 @@
|
|||
endpoint LanguageClient = 8002
|
||||
endpoint LanguageClient
|
||||
{
|
||||
AutoCompleteSuggestions(Vector<GUI::AutocompleteProvider::Entry> suggestions) =|
|
||||
DeclarationLocation(GUI::AutocompleteProvider::ProjectLocation location) =|
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
endpoint LanguageServer = 8001
|
||||
endpoint LanguageServer
|
||||
{
|
||||
Greet(String project_root) => ()
|
||||
|
||||
|
|
|
@ -164,11 +164,7 @@ int main(int argc, char** argv)
|
|||
lexer.consume_specific("endpoint");
|
||||
consume_whitespace();
|
||||
endpoints.last().name = lexer.consume_while([](char ch) { return !isspace(ch); });
|
||||
consume_whitespace();
|
||||
assert_specific('=');
|
||||
consume_whitespace();
|
||||
auto magic_string = lexer.consume_while([](char ch) { return !isspace(ch) && ch != '{'; });
|
||||
endpoints.last().magic = magic_string.to_int().value();
|
||||
endpoints.last().magic = Traits<String>::hash(endpoints.last().name);
|
||||
consume_whitespace();
|
||||
assert_specific('{');
|
||||
parse_messages();
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
endpoint AudioClient = 82
|
||||
endpoint AudioClient
|
||||
{
|
||||
FinishedPlayingBuffer(i32 buffer_id) =|
|
||||
MutedStateChanged(bool muted) =|
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
endpoint AudioServer = 85
|
||||
endpoint AudioServer
|
||||
{
|
||||
// Basic protocol
|
||||
Greet() => ()
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
endpoint ClipboardClient = 804
|
||||
endpoint ClipboardClient
|
||||
{
|
||||
ClipboardDataChanged([UTF8] String mime_type) =|
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
endpoint ClipboardServer = 802
|
||||
endpoint ClipboardServer
|
||||
{
|
||||
Greet() => ()
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
endpoint ImageDecoderClient = 7002
|
||||
endpoint ImageDecoderClient
|
||||
{
|
||||
Dummy() =|
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
endpoint ImageDecoderServer = 7001
|
||||
endpoint ImageDecoderServer
|
||||
{
|
||||
Greet() => ()
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
endpoint LaunchClient = 102
|
||||
endpoint LaunchClient
|
||||
{
|
||||
Dummy() =|
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
endpoint LaunchServer = 101
|
||||
endpoint LaunchServer
|
||||
{
|
||||
Greet() => ()
|
||||
OpenURL(URL url, String handler_name) => (bool response)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
endpoint LookupClient = 9002
|
||||
endpoint LookupClient
|
||||
{
|
||||
Dummy() =|
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
endpoint LookupServer = 9001
|
||||
endpoint LookupServer
|
||||
{
|
||||
LookupName(String name) => (int code, Vector<String> addresses)
|
||||
LookupAddress(String address) => (int code, String name)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
endpoint NotificationClient = 92
|
||||
endpoint NotificationClient
|
||||
{
|
||||
Dummy() =|
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
endpoint NotificationServer = 95
|
||||
endpoint NotificationServer
|
||||
{
|
||||
// Basic protocol
|
||||
Greet() => ()
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
endpoint ProtocolClient = 13
|
||||
endpoint ProtocolClient
|
||||
{
|
||||
// Download notifications
|
||||
DownloadProgress(i32 download_id, Optional<u32> total_size, u32 downloaded_size) =|
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
endpoint ProtocolServer = 9
|
||||
endpoint ProtocolServer
|
||||
{
|
||||
// Basic protocol
|
||||
Greet() => ()
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
endpoint SymbolClient = 4541511
|
||||
endpoint SymbolClient
|
||||
{
|
||||
Dummy() =|
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
endpoint SymbolServer = 4541510
|
||||
endpoint SymbolServer
|
||||
{
|
||||
Greet() => ()
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
endpoint WebContentClient = 90
|
||||
endpoint WebContentClient
|
||||
{
|
||||
DidStartLoading(URL url) =|
|
||||
DidFinishLoading(URL url) =|
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
endpoint WebContentServer = 89
|
||||
endpoint WebContentServer
|
||||
{
|
||||
Greet() => ()
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
endpoint WindowClient = 4
|
||||
endpoint WindowClient
|
||||
{
|
||||
Paint(i32 window_id, Gfx::IntSize window_size, Vector<Gfx::IntRect> rects) =|
|
||||
MouseMove(i32 window_id, Gfx::IntPoint mouse_position, u32 button, u32 buttons, u32 modifiers, i32 wheel_delta, bool is_drag, Vector<String> mime_types) =|
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
endpoint WindowManagerClient = 1872
|
||||
endpoint WindowManagerClient
|
||||
{
|
||||
WindowRemoved(i32 wm_id, i32 client_id, i32 window_id) =|
|
||||
WindowStateChanged(i32 wm_id, i32 client_id, i32 window_id, i32 parent_client_id, i32 parent_window_id, bool is_active, bool is_minimized, bool is_modal, bool is_frameless, i32 window_type, [UTF8] String title, Gfx::IntRect rect, i32 progress) =|
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
endpoint WindowManagerServer = 1871
|
||||
endpoint WindowManagerServer
|
||||
{
|
||||
SetEventMask(u32 event_mask) => ()
|
||||
SetManagerWindow(i32 window_id) => ()
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
endpoint WindowServer = 2
|
||||
endpoint WindowServer
|
||||
{
|
||||
Greet() => (Gfx::IntRect screen_rect, Core::AnonymousBuffer theme_buffer)
|
||||
|
||||
|
|
Loading…
Reference in a new issue