diff options
author | Andreas Kling <kling@serenityos.org> | 2020-02-15 02:09:00 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-02-15 02:09:00 +0100 |
commit | 0e3a9d8e9db7b727c7e7ad2b61f29c3ff0f71279 (patch) | |
tree | ed31019384d39ad0aeb1b2737213c23025f6cff0 /Libraries/LibCore/EventLoop.h | |
parent | b011ea9962ec66e9ff1793e278ffb91239324528 (diff) | |
download | serenity-0e3a9d8e9db7b727c7e7ad2b61f29c3ff0f71279.zip |
LibCore: Reduce header dependencies of EventLoop
Diffstat (limited to 'Libraries/LibCore/EventLoop.h')
-rw-r--r-- | Libraries/LibCore/EventLoop.h | 28 |
1 files changed, 5 insertions, 23 deletions
diff --git a/Libraries/LibCore/EventLoop.h b/Libraries/LibCore/EventLoop.h index 4d7807b2e9..e1f4891ba6 100644 --- a/Libraries/LibCore/EventLoop.h +++ b/Libraries/LibCore/EventLoop.h @@ -27,13 +27,11 @@ #pragma once #include <AK/Forward.h> -#include <AK/HashMap.h> -#include <AK/OwnPtr.h> +#include <AK/Noncopyable.h> +#include <AK/NonnullOwnPtr.h> #include <AK/Vector.h> #include <AK/WeakPtr.h> #include <LibCore/Forward.h> -#include <LibCore/Object.h> -#include <LibThread/Lock.h> #include <sys/time.h> namespace Core { @@ -83,6 +81,7 @@ private: struct QueuedEvent { AK_MAKE_NONCOPYABLE(QueuedEvent); + public: QueuedEvent(Object& receiver, NonnullOwnPtr<Event>); QueuedEvent(QueuedEvent&&); @@ -99,25 +98,8 @@ private: static int s_wake_pipe_fds[2]; - LibThread::Lock m_lock; - - struct EventLoopTimer { - int timer_id { 0 }; - int interval { 0 }; - timeval fire_time { 0, 0 }; - bool should_reload { false }; - TimerShouldFireWhenNotVisible fire_when_not_visible { TimerShouldFireWhenNotVisible::No }; - WeakPtr<Object> owner; - - void reload(const timeval& now); - bool has_expired(const timeval& now) const; - }; - - static HashMap<int, NonnullOwnPtr<EventLoopTimer>>* s_timers; - - static HashTable<Notifier*>* s_notifiers; - - static RefPtr<LocalServer> s_rpc_server; + struct Private; + NonnullOwnPtr<Private> m_private; }; } |