mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 20:29:18 +00:00
LibIPC: Move stuff from Connection.h to .cpp and reduce #include count
This commit is contained in:
parent
6d9c4d852d
commit
4fe21e6d87
Notes:
sideshowbarker
2024-07-17 18:06:52 +09:00
Author: https://github.com/awesomekling
Commit: 4fe21e6d87
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/303
4 changed files with 23 additions and 17 deletions
|
@ -5,9 +5,11 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibCore/System.h>
|
||||
#include <AK/Vector.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>
|
||||
|
||||
namespace IPC {
|
||||
|
@ -18,6 +20,19 @@ ConnectionBase::ConnectionBase(IPC::Stub& local_stub, NonnullOwnPtr<Core::LocalS
|
|||
, m_local_endpoint_magic(local_endpoint_magic)
|
||||
{
|
||||
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();
|
||||
}
|
||||
|
||||
ErrorOr<void> ConnectionBase::post_message(Message const& message)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue