소스 검색

LibIPC: Stop sending client ID to clients

The client ID is not useful to normal clients anymore, so stop telling
everyone what their ID is.
Andreas Kling 4 년 전
부모
커밋
1ce03f4f34
29개의 변경된 파일27개의 추가작업 그리고 42개의 파일을 삭제
  1. 1 2
      Userland/DevTools/HackStudio/LanguageClient.h
  2. 1 1
      Userland/DevTools/HackStudio/LanguageServers/Cpp/ClientConnection.cpp
  3. 1 1
      Userland/DevTools/HackStudio/LanguageServers/LanguageServer.ipc
  4. 1 1
      Userland/DevTools/HackStudio/LanguageServers/Shell/ClientConnection.cpp
  5. 1 2
      Userland/Libraries/LibAudio/ClientConnection.cpp
  6. 1 2
      Userland/Libraries/LibDesktop/Launcher.cpp
  7. 1 2
      Userland/Libraries/LibGUI/Clipboard.cpp
  8. 1 2
      Userland/Libraries/LibGUI/Notification.cpp
  9. 0 1
      Userland/Libraries/LibGUI/WindowServerConnection.cpp
  10. 0 6
      Userland/Libraries/LibIPC/ServerConnection.h
  11. 1 2
      Userland/Libraries/LibImageDecoderClient/Client.cpp
  12. 1 2
      Userland/Libraries/LibProtocol/Client.cpp
  13. 1 2
      Userland/Libraries/LibWeb/WebContentClient.cpp
  14. 1 1
      Userland/Services/AudioServer/AudioServer.ipc
  15. 1 1
      Userland/Services/AudioServer/ClientConnection.cpp
  16. 1 1
      Userland/Services/Clipboard/ClientConnection.cpp
  17. 1 1
      Userland/Services/Clipboard/ClipboardServer.ipc
  18. 1 1
      Userland/Services/ImageDecoder/ClientConnection.cpp
  19. 1 1
      Userland/Services/ImageDecoder/ImageDecoderServer.ipc
  20. 1 1
      Userland/Services/LaunchServer/ClientConnection.cpp
  21. 1 1
      Userland/Services/LaunchServer/LaunchServer.ipc
  22. 1 1
      Userland/Services/NotificationServer/ClientConnection.cpp
  23. 1 1
      Userland/Services/NotificationServer/NotificationServer.ipc
  24. 1 1
      Userland/Services/ProtocolServer/ClientConnection.cpp
  25. 1 1
      Userland/Services/ProtocolServer/ProtocolServer.ipc
  26. 1 1
      Userland/Services/WebContent/ClientConnection.cpp
  27. 1 1
      Userland/Services/WebContent/WebContentServer.ipc
  28. 1 1
      Userland/Services/WindowServer/ClientConnection.cpp
  29. 1 1
      Userland/Services/WindowServer/WindowServer.ipc

+ 1 - 2
Userland/DevTools/HackStudio/LanguageClient.h

@@ -62,8 +62,7 @@ public:
 
     virtual void handshake() override
     {
-        auto response = send_sync<Messages::LanguageServer::Greet>();
-        set_my_client_id(response->client_id());
+        send_sync<Messages::LanguageServer::Greet>();
     }
 
     WeakPtr<LanguageClient> language_client() { return m_language_client; }

+ 1 - 1
Userland/DevTools/HackStudio/LanguageServers/Cpp/ClientConnection.cpp

@@ -54,7 +54,7 @@ void ClientConnection::die()
 
 OwnPtr<Messages::LanguageServer::GreetResponse> ClientConnection::handle(const Messages::LanguageServer::Greet&)
 {
-    return make<Messages::LanguageServer::GreetResponse>(client_id());
+    return make<Messages::LanguageServer::GreetResponse>();
 }
 
 class DefaultDocumentClient final : public GUI::TextDocument::Client {

+ 1 - 1
Userland/DevTools/HackStudio/LanguageServers/LanguageServer.ipc

@@ -1,6 +1,6 @@
 endpoint LanguageServer = 8001
 {
-    Greet() => (i32 client_id)
+    Greet() => ()
 
     FileOpened(String file_name, IPC::File file) =|
     FileEditInsertText(String file_name, String text, i32 start_line, i32 start_column) =|

+ 1 - 1
Userland/DevTools/HackStudio/LanguageServers/Shell/ClientConnection.cpp

@@ -53,7 +53,7 @@ void ClientConnection::die()
 
 OwnPtr<Messages::LanguageServer::GreetResponse> ClientConnection::handle(const Messages::LanguageServer::Greet&)
 {
-    return make<Messages::LanguageServer::GreetResponse>(client_id());
+    return make<Messages::LanguageServer::GreetResponse>();
 }
 
 class DefaultDocumentClient final : public GUI::TextDocument::Client {

+ 1 - 2
Userland/Libraries/LibAudio/ClientConnection.cpp

@@ -36,8 +36,7 @@ ClientConnection::ClientConnection()
 
 void ClientConnection::handshake()
 {
-    auto response = send_sync<Messages::AudioServer::Greet>();
-    set_my_client_id(response->client_id());
+    send_sync<Messages::AudioServer::Greet>();
 }
 
 void ClientConnection::enqueue(const Buffer& buffer)

+ 1 - 2
Userland/Libraries/LibDesktop/Launcher.cpp

@@ -60,8 +60,7 @@ class LaunchServerConnection : public IPC::ServerConnection<LaunchClientEndpoint
 public:
     virtual void handshake() override
     {
-        auto response = send_sync<Messages::LaunchServer::Greet>();
-        set_my_client_id(response->client_id());
+        send_sync<Messages::LaunchServer::Greet>();
     }
 
 private:

+ 1 - 2
Userland/Libraries/LibGUI/Clipboard.cpp

@@ -39,8 +39,7 @@ class ClipboardServerConnection : public IPC::ServerConnection<ClipboardClientEn
 public:
     virtual void handshake() override
     {
-        auto response = send_sync<Messages::ClipboardServer::Greet>();
-        set_my_client_id(response->client_id());
+        send_sync<Messages::ClipboardServer::Greet>();
     }
 
 private:

+ 1 - 2
Userland/Libraries/LibGUI/Notification.cpp

@@ -37,8 +37,7 @@ class NotificationServerConnection : public IPC::ServerConnection<NotificationCl
 public:
     virtual void handshake() override
     {
-        auto response = send_sync<Messages::NotificationServer::Greet>();
-        set_my_client_id(response->client_id());
+        send_sync<Messages::NotificationServer::Greet>();
     }
 
 private:

+ 0 - 1
Userland/Libraries/LibGUI/WindowServerConnection.cpp

@@ -63,7 +63,6 @@ static void set_system_theme_from_anonymous_buffer(Core::AnonymousBuffer buffer)
 void WindowServerConnection::handshake()
 {
     auto response = send_sync<Messages::WindowServer::Greet>();
-    set_my_client_id(response->client_id());
     set_system_theme_from_anonymous_buffer(response->theme_buffer());
     Desktop::the().did_receive_screen_rect({}, response->screen_rect());
 }

+ 0 - 6
Userland/Libraries/LibIPC/ServerConnection.h

@@ -49,17 +49,11 @@ public:
 
     virtual void handshake() = 0;
 
-    void set_my_client_id(int id) { m_my_client_id = id; }
-    int my_client_id() const { return m_my_client_id; }
-
     virtual void die() override
     {
         // Override this function if you don't want your app to exit if it loses the connection.
         exit(0);
     }
-
-private:
-    int m_my_client_id { -1 };
 };
 
 }

+ 1 - 2
Userland/Libraries/LibImageDecoderClient/Client.cpp

@@ -37,8 +37,7 @@ Client::Client()
 
 void Client::handshake()
 {
-    auto response = send_sync<Messages::ImageDecoderServer::Greet>();
-    set_my_client_id(response->client_id());
+    send_sync<Messages::ImageDecoderServer::Greet>();
 }
 
 void Client::handle(const Messages::ImageDecoderClient::Dummy&)

+ 1 - 2
Userland/Libraries/LibProtocol/Client.cpp

@@ -38,8 +38,7 @@ Client::Client()
 
 void Client::handshake()
 {
-    auto response = send_sync<Messages::ProtocolServer::Greet>();
-    set_my_client_id(response->client_id());
+    send_sync<Messages::ProtocolServer::Greet>();
 }
 
 bool Client::is_supported_protocol(const String& protocol)

+ 1 - 2
Userland/Libraries/LibWeb/WebContentClient.cpp

@@ -45,8 +45,7 @@ void WebContentClient::die()
 
 void WebContentClient::handshake()
 {
-    auto response = send_sync<Messages::WebContentServer::Greet>();
-    set_my_client_id(response->client_id());
+    send_sync<Messages::WebContentServer::Greet>();
 }
 
 void WebContentClient::handle(const Messages::WebContentClient::DidPaint& message)

+ 1 - 1
Userland/Services/AudioServer/AudioServer.ipc

@@ -1,7 +1,7 @@
 endpoint AudioServer = 85
 {
     // Basic protocol
-    Greet() => (i32 client_id)
+    Greet() => ()
 
     // Mixer functions
     SetMuted(bool muted) => ()

+ 1 - 1
Userland/Services/AudioServer/ClientConnection.cpp

@@ -81,7 +81,7 @@ void ClientConnection::did_change_main_mix_volume(Badge<Mixer>, int volume)
 
 OwnPtr<Messages::AudioServer::GreetResponse> ClientConnection::handle(const Messages::AudioServer::Greet&)
 {
-    return make<Messages::AudioServer::GreetResponse>(client_id());
+    return make<Messages::AudioServer::GreetResponse>();
 }
 
 OwnPtr<Messages::AudioServer::GetMainMixVolumeResponse> ClientConnection::handle(const Messages::AudioServer::GetMainMixVolume&)

+ 1 - 1
Userland/Services/Clipboard/ClientConnection.cpp

@@ -57,7 +57,7 @@ void ClientConnection::die()
 
 OwnPtr<Messages::ClipboardServer::GreetResponse> ClientConnection::handle(const Messages::ClipboardServer::Greet&)
 {
-    return make<Messages::ClipboardServer::GreetResponse>(client_id());
+    return make<Messages::ClipboardServer::GreetResponse>();
 }
 
 OwnPtr<Messages::ClipboardServer::SetClipboardDataResponse> ClientConnection::handle(const Messages::ClipboardServer::SetClipboardData& message)

+ 1 - 1
Userland/Services/Clipboard/ClipboardServer.ipc

@@ -1,6 +1,6 @@
 endpoint ClipboardServer = 802
 {
-    Greet() => (i32 client_id)
+    Greet() => ()
 
     GetClipboardData() => (Core::AnonymousBuffer data, [UTF8] String mime_type, IPC::Dictionary metadata)
     SetClipboardData(Core::AnonymousBuffer data, [UTF8] String mime_type, IPC::Dictionary metadata) => ()

+ 1 - 1
Userland/Services/ImageDecoder/ClientConnection.cpp

@@ -53,7 +53,7 @@ void ClientConnection::die()
 
 OwnPtr<Messages::ImageDecoderServer::GreetResponse> ClientConnection::handle(const Messages::ImageDecoderServer::Greet&)
 {
-    return make<Messages::ImageDecoderServer::GreetResponse>(client_id());
+    return make<Messages::ImageDecoderServer::GreetResponse>();
 }
 
 OwnPtr<Messages::ImageDecoderServer::DecodeImageResponse> ClientConnection::handle(const Messages::ImageDecoderServer::DecodeImage& message)

+ 1 - 1
Userland/Services/ImageDecoder/ImageDecoderServer.ipc

@@ -1,6 +1,6 @@
 endpoint ImageDecoderServer = 7001
 {
-    Greet() => (i32 client_id)
+    Greet() => ()
 
     DecodeImage(Core::AnonymousBuffer data) => (bool is_animated, u32 loop_count, Vector<Gfx::ShareableBitmap> bitmaps, Vector<u32> durations)
 }

+ 1 - 1
Userland/Services/LaunchServer/ClientConnection.cpp

@@ -50,7 +50,7 @@ void ClientConnection::die()
 
 OwnPtr<Messages::LaunchServer::GreetResponse> ClientConnection::handle(const Messages::LaunchServer::Greet&)
 {
-    return make<Messages::LaunchServer::GreetResponse>(client_id());
+    return make<Messages::LaunchServer::GreetResponse>();
 }
 
 OwnPtr<Messages::LaunchServer::OpenURLResponse> ClientConnection::handle(const Messages::LaunchServer::OpenURL& request)

+ 1 - 1
Userland/Services/LaunchServer/LaunchServer.ipc

@@ -1,6 +1,6 @@
 endpoint LaunchServer = 101
 {
-    Greet() => (i32 client_id)
+    Greet() => ()
     OpenURL(URL url, String handler_name) => (bool response)
     GetHandlersForURL(URL url) => (Vector<String> handlers)
     GetHandlersWithDetailsForURL(URL url) => (Vector<String> handlers_details)

+ 1 - 1
Userland/Services/NotificationServer/ClientConnection.cpp

@@ -50,7 +50,7 @@ void ClientConnection::die()
 
 OwnPtr<Messages::NotificationServer::GreetResponse> ClientConnection::handle(const Messages::NotificationServer::Greet&)
 {
-    return make<Messages::NotificationServer::GreetResponse>(client_id());
+    return make<Messages::NotificationServer::GreetResponse>();
 }
 
 OwnPtr<Messages::NotificationServer::ShowNotificationResponse> ClientConnection::handle(const Messages::NotificationServer::ShowNotification& message)

+ 1 - 1
Userland/Services/NotificationServer/NotificationServer.ipc

@@ -1,7 +1,7 @@
 endpoint NotificationServer = 95
 {
     // Basic protocol
-    Greet() => (i32 client_id)
+    Greet() => ()
 
     ShowNotification([UTF8] String text, [UTF8] String title, Gfx::ShareableBitmap icon) => ()
 }

+ 1 - 1
Userland/Services/ProtocolServer/ClientConnection.cpp

@@ -122,7 +122,7 @@ void ClientConnection::did_request_certificates(Badge<Download>, Download& downl
 
 OwnPtr<Messages::ProtocolServer::GreetResponse> ClientConnection::handle(const Messages::ProtocolServer::Greet&)
 {
-    return make<Messages::ProtocolServer::GreetResponse>(client_id());
+    return make<Messages::ProtocolServer::GreetResponse>();
 }
 
 OwnPtr<Messages::ProtocolServer::SetCertificateResponse> ClientConnection::handle(const Messages::ProtocolServer::SetCertificate& message)

+ 1 - 1
Userland/Services/ProtocolServer/ProtocolServer.ipc

@@ -1,7 +1,7 @@
 endpoint ProtocolServer = 9
 {
     // Basic protocol
-    Greet() => (i32 client_id)
+    Greet() => ()
 
     // Test if a specific protocol is supported, e.g "http"
     IsSupportedProtocol(String protocol) => (bool supported)

+ 1 - 1
Userland/Services/WebContent/ClientConnection.cpp

@@ -78,7 +78,7 @@ const Web::Page& ClientConnection::page() const
 
 OwnPtr<Messages::WebContentServer::GreetResponse> ClientConnection::handle(const Messages::WebContentServer::Greet&)
 {
-    return make<Messages::WebContentServer::GreetResponse>(client_id());
+    return make<Messages::WebContentServer::GreetResponse>();
 }
 
 void ClientConnection::handle(const Messages::WebContentServer::UpdateSystemTheme& message)

+ 1 - 1
Userland/Services/WebContent/WebContentServer.ipc

@@ -1,6 +1,6 @@
 endpoint WebContentServer = 89
 {
-    Greet() => (i32 client_id)
+    Greet() => ()
 
     UpdateSystemTheme(Core::AnonymousBuffer theme_buffer) =|
 

+ 1 - 1
Userland/Services/WindowServer/ClientConnection.cpp

@@ -722,7 +722,7 @@ void ClientConnection::handle(const Messages::WindowServer::WM_SetWindowMinimize
 
 OwnPtr<Messages::WindowServer::GreetResponse> ClientConnection::handle(const Messages::WindowServer::Greet&)
 {
-    return make<Messages::WindowServer::GreetResponse>(client_id(), Screen::the().rect(), Gfx::current_system_theme_buffer());
+    return make<Messages::WindowServer::GreetResponse>(Screen::the().rect(), Gfx::current_system_theme_buffer());
 }
 
 void ClientConnection::handle(const Messages::WindowServer::WM_SetWindowTaskbarRect& message)

+ 1 - 1
Userland/Services/WindowServer/WindowServer.ipc

@@ -1,6 +1,6 @@
 endpoint WindowServer = 2
 {
-    Greet() => (i32 client_id, Gfx::IntRect screen_rect, Core::AnonymousBuffer theme_buffer)
+    Greet() => (Gfx::IntRect screen_rect, Core::AnonymousBuffer theme_buffer)
 
     CreateMenubar() => (i32 menubar_id)
     DestroyMenubar(i32 menubar_id) => ()