mirror of
https://github.com/SerenityOS/serenity.git
synced 2026-11-07 04:29:30 -10:00
LibIPC: Move stuff from Connection.h to .cpp and reduce #include count
(cherry picked from commit 4fe21e6d87259718f2d2a727a479e780963d76f4; amended to add missing includes to various serenity components)
This commit is contained in:
1 parent
8fb4aac9d7
commit
02fd716e36
12 files changed
+32
-17
No files matched your search
@@ -7,6 +7,7 @@
|
||||
#include "PlaybackStreamSerenity.h"
|
||||
|
||||
#include <LibCore/ThreadedPromise.h>
|
||||
#include <LibCore/Timer.h>
|
||||
|
||||
namespace Audio {
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibCore/EventLoop.h>
|
||||
#include <LibGUI/ConnectionToWindowManagerServer.h>
|
||||
#include <LibGUI/Event.h>
|
||||
#include <LibGUI/Window.h>
|
||||
|
||||
@@ -5,9 +5,12 @@
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibCore/System.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <LibCore/EventLoop.h>
|
||||
#include <LibCore/Socket.h>
|
||||
#include <LibCore/Timer.h>
|
||||
#include <LibIPC/Connection.h>
|
||||
#include <LibIPC/File.h>
|
||||
#include <LibIPC/Message.h>
|
||||
#include <LibIPC/Stub.h>
|
||||
#include <sys/select.h>
|
||||
|
||||
@@ -29,6 +32,19 @@ ConnectionBase::ConnectionBase(IPC::Stub& local_stub, NonnullOwnPtr<Core::LocalS
|
||||
, m_deferred_invoker(make<CoreEventLoopDeferredInvoker>())
|
||||
{
|
||||
m_responsiveness_timer = Core::Timer::create_single_shot(3000, [this] { may_have_become_unresponsive(); });
|
||||
m_socket->on_ready_to_read = [this] {
|
||||
NonnullRefPtr protect = *this;
|
||||
// FIXME: Do something about errors.
|
||||
(void)drain_messages_from_peer();
|
||||
handle_messages();
|
||||
};
|
||||
}
|
||||
|
||||
ConnectionBase::~ConnectionBase() = default;
|
||||
|
||||
bool ConnectionBase::is_open() const
|
||||
{
|
||||
return m_socket->is_open();
|
||||
}
|
||||
|
||||
void ConnectionBase::set_deferred_invoker(NonnullOwnPtr<DeferredInvoker> deferred_invoker)
|
||||
|
||||
@@ -7,16 +7,11 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/ByteBuffer.h>
|
||||
#include <AK/Forward.h>
|
||||
#include <AK/Queue.h>
|
||||
#include <AK/Try.h>
|
||||
#include <LibCore/Event.h>
|
||||
#include <LibCore/EventLoop.h>
|
||||
#include <LibCore/Socket.h>
|
||||
#include <LibCore/Timer.h>
|
||||
#include <LibCore/EventReceiver.h>
|
||||
#include <LibIPC/File.h>
|
||||
#include <LibIPC/Forward.h>
|
||||
#include <LibIPC/Message.h>
|
||||
|
||||
namespace IPC {
|
||||
|
||||
@@ -31,12 +26,12 @@ class ConnectionBase : public Core::EventReceiver {
|
||||
C_OBJECT_ABSTRACT(ConnectionBase);
|
||||
|
||||
public:
|
||||
virtual ~ConnectionBase() override = default;
|
||||
virtual ~ConnectionBase() override;
|
||||
|
||||
void set_deferred_invoker(NonnullOwnPtr<DeferredInvoker>);
|
||||
DeferredInvoker& deferred_invoker() { return *m_deferred_invoker; }
|
||||
|
||||
bool is_open() const { return m_socket->is_open(); }
|
||||
[[nodiscard]] bool is_open() const;
|
||||
enum class MessageKind {
|
||||
Async,
|
||||
Sync,
|
||||
@@ -86,12 +81,6 @@ public:
|
||||
Connection(IPC::Stub& local_stub, NonnullOwnPtr<Core::LocalSocket> socket)
|
||||
: ConnectionBase(local_stub, move(socket), LocalEndpoint::static_magic())
|
||||
{
|
||||
m_socket->on_ready_to_read = [this] {
|
||||
NonnullRefPtr protect = *this;
|
||||
// FIXME: Do something about errors.
|
||||
(void)drain_messages_from_peer();
|
||||
handle_messages();
|
||||
};
|
||||
}
|
||||
|
||||
template<typename MessageType>
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <AK/String.h>
|
||||
#include <LibCore/DateTime.h>
|
||||
#include <LibCore/StandardPaths.h>
|
||||
#include <LibCore/Timer.h>
|
||||
#include <LibGfx/ImageFormats/PNGWriter.h>
|
||||
#include <LibWeb/Infra/Strings.h>
|
||||
#include <LibWebView/ViewImplementation.h>
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
|
||||
#include "ConnectionFromClient.h"
|
||||
#include <LibCore/EventLoop.h>
|
||||
#include <LibCore/StandardPaths.h>
|
||||
#include <LibCore/System.h>
|
||||
#include <LibIPC/MultiServer.h>
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibCore/EventLoop.h>
|
||||
#include <LibCore/EventReceiver.h>
|
||||
#include <LibSQL/AST/Parser.h>
|
||||
#include <SQLServer/ConnectionFromClient.h>
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibCore/EventLoop.h>
|
||||
#include <WebWorker/ConnectionFromClient.h>
|
||||
#include <WebWorker/DedicatedWorkerHost.h>
|
||||
#include <WebWorker/PageHost.h>
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
#include <AK/Badge.h>
|
||||
#include <LibCore/MimeData.h>
|
||||
#include <LibCore/Timer.h>
|
||||
#include <LibGfx/Bitmap.h>
|
||||
#include <LibGfx/StandardCursor.h>
|
||||
#include <LibGfx/SystemTheme.h>
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include "Window.h"
|
||||
#include "WindowManager.h"
|
||||
#include <AK/CharacterTypes.h>
|
||||
#include <LibCore/Timer.h>
|
||||
#include <LibGfx/Bitmap.h>
|
||||
#include <LibGfx/CharacterBitmap.h>
|
||||
#include <LibGfx/Font/Font.h>
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <AK/Debug.h>
|
||||
#include <AK/Format.h>
|
||||
#include <Kernel/API/MousePacket.h>
|
||||
#include <LibCore/EventLoop.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/devices/gpu.h>
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
#include "ConnectionFromClient.h"
|
||||
#include <AK/Badge.h>
|
||||
#include <LibCore/Timer.h>
|
||||
#include <LibGfx/Font/Font.h>
|
||||
#include <LibGfx/Painter.h>
|
||||
#include <LibGfx/StylePainter.h>
|
||||
|
||||
Reference in new issue
Block a user