From 0e7a48bd7dd6b92057daf88884c9588b300a0c9d Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Wed, 18 Jan 2023 14:00:19 -0500 Subject: [PATCH] LibCore: Allow subclassing FileWatcher This will be handy for platforms which need to be able to store extra OS-specific members. For example, macOS needs to store a dispatch queue, and event stream, etc. --- Userland/Libraries/LibCore/FileWatcher.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibCore/FileWatcher.h b/Userland/Libraries/LibCore/FileWatcher.h index 501213aedb..694e9f485b 100644 --- a/Userland/Libraries/LibCore/FileWatcher.h +++ b/Userland/Libraries/LibCore/FileWatcher.h @@ -69,7 +69,7 @@ public: Optional wait_for_event(); }; -class FileWatcher final : public FileWatcherBase +class FileWatcher : public FileWatcherBase , public RefCounted { AK_MAKE_NONCOPYABLE(FileWatcher); @@ -79,7 +79,7 @@ public: Function on_change; -private: +protected: FileWatcher(int watcher_fd, NonnullRefPtr); NonnullRefPtr m_notifier;