Files
ladybird/Userland/Libraries/LibCore/Platform/ProcessStatistics.h
Andrew Kaster 4cc3d598f9 LibWebView+LibCore: Manage process lifecycle using a SIGCHLD handler
This large commit also refactors LibWebView's process handling to use
a top-level Application class that uses a new WebView::Process class to
encapsulate the IPC-centric nature of each helper process.
2024-07-01 18:10:56 +02:00

32 lines
645 B
C++

/*
* Copyright (c) 2024, Andrew Kaster <akaster@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/Error.h>
#include <AK/NonnullOwnPtr.h>
#include <AK/TypeCasts.h>
#include <AK/Vector.h>
#include <LibCore/Platform/ProcessInfo.h>
namespace Core::Platform {
struct ProcessStatistics {
template<typename Callback>
void for_each_process(Callback&& callback)
{
for (auto& process : processes)
callback(*process);
}
u64 total_time_scheduled { 0 };
Vector<NonnullOwnPtr<ProcessInfo>> processes;
};
ErrorOr<void> update_process_statistics(ProcessStatistics&);
}