From c9e849a968175790d9cdbe0fe8f2e25ecb4a5dff Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 22 May 2021 23:26:51 +0200 Subject: [PATCH] LibCore: Make all processes opt out of InspectorServer by default This functionality, while neat, isn't really something you need enabled all the time. Let's make it opt-in instead. Pass MakeInspectable::Yes to the Core::EventLoop constructor if you want your program to become inspectable. --- Userland/Libraries/LibCore/EventLoop.h | 2 +- Userland/Services/InspectorServer/main.cpp | 2 +- Userland/Services/WindowServer/EventLoop.cpp | 3 +-- Userland/Utilities/bt.cpp | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Userland/Libraries/LibCore/EventLoop.h b/Userland/Libraries/LibCore/EventLoop.h index c47d963cf62..c2d03307ef2 100644 --- a/Userland/Libraries/LibCore/EventLoop.h +++ b/Userland/Libraries/LibCore/EventLoop.h @@ -26,7 +26,7 @@ public: Yes, }; - EventLoop(MakeInspectable = MakeInspectable::Yes); + explicit EventLoop(MakeInspectable = MakeInspectable::No); ~EventLoop(); int exec(); diff --git a/Userland/Services/InspectorServer/main.cpp b/Userland/Services/InspectorServer/main.cpp index de1e7d1704e..83d0bbd41f7 100644 --- a/Userland/Services/InspectorServer/main.cpp +++ b/Userland/Services/InspectorServer/main.cpp @@ -12,7 +12,7 @@ int main(int, char**) { - Core::EventLoop event_loop(Core::EventLoop::MakeInspectable::No); + Core::EventLoop event_loop; auto server = Core::LocalServer::construct(); if (pledge("stdio unix accept", nullptr) < 0) { diff --git a/Userland/Services/WindowServer/EventLoop.cpp b/Userland/Services/WindowServer/EventLoop.cpp index a79fbd4d580..5bc5b4a0624 100644 --- a/Userland/Services/WindowServer/EventLoop.cpp +++ b/Userland/Services/WindowServer/EventLoop.cpp @@ -27,8 +27,7 @@ namespace WindowServer { EventLoop::EventLoop() - : m_event_loop(Core::EventLoop::MakeInspectable::No) - , m_window_server(Core::LocalServer::construct()) + : m_window_server(Core::LocalServer::construct()) , m_wm_server(Core::LocalServer::construct()) { m_keyboard_fd = open("/dev/keyboard0", O_RDONLY | O_NONBLOCK | O_CLOEXEC); diff --git a/Userland/Utilities/bt.cpp b/Userland/Utilities/bt.cpp index d1917c7e0e6..957e407197e 100644 --- a/Userland/Utilities/bt.cpp +++ b/Userland/Utilities/bt.cpp @@ -27,7 +27,7 @@ int main(int argc, char** argv) pid_t pid = 0; args_parser.add_positional_argument(pid, "PID", "pid"); args_parser.parse(argc, argv); - Core::EventLoop loop(Core::EventLoop::MakeInspectable::No); + Core::EventLoop loop; Core::DirIterator iterator(String::formatted("/proc/{}/stacks", pid), Core::DirIterator::SkipDots); if (iterator.has_error()) {