mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
23 lines
534 B
C++
23 lines
534 B
C++
/*
|
|
* Copyright (c) 2024, Andrew Kaster <akaster@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include <LibIPC/Decoder.h>
|
|
#include <LibIPC/Encoder.h>
|
|
#include <LibWebView/ProcessHandle.h>
|
|
|
|
template<>
|
|
ErrorOr<void> IPC::encode(IPC::Encoder& encoder, WebView::ProcessHandle const& handle)
|
|
{
|
|
TRY(encoder.encode(handle.pid));
|
|
return {};
|
|
}
|
|
|
|
template<>
|
|
ErrorOr<WebView::ProcessHandle> IPC::decode(IPC::Decoder& decoder)
|
|
{
|
|
auto pid = TRY(decoder.decode<pid_t>());
|
|
return WebView::ProcessHandle { pid };
|
|
}
|