mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
Everywhere: Hoist the Libraries folder to the top-level
This commit is contained in:
parent
950e819ee7
commit
93712b24bf
Notes:
github-actions[bot]
2024-11-10 11:51:52 +00:00
Author: https://github.com/trflynn89
Commit: 93712b24bf
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2256
Reviewed-by: https://github.com/sideshowbarker
4547 changed files with 104 additions and 113 deletions
50
Libraries/LibWebView/ProcessManager.h
Normal file
50
Libraries/LibWebView/ProcessManager.h
Normal file
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
* Copyright (c) 2024, Andrew Kaster <akaster@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Types.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <LibCore/EventReceiver.h>
|
||||
#include <LibCore/Platform/ProcessStatistics.h>
|
||||
#include <LibThreading/Mutex.h>
|
||||
#include <LibWebView/Forward.h>
|
||||
#include <LibWebView/Process.h>
|
||||
#include <LibWebView/ProcessType.h>
|
||||
|
||||
namespace WebView {
|
||||
|
||||
ProcessType process_type_from_name(StringView);
|
||||
StringView process_name_from_type(ProcessType type);
|
||||
|
||||
class ProcessManager {
|
||||
AK_MAKE_NONCOPYABLE(ProcessManager);
|
||||
|
||||
public:
|
||||
ProcessManager();
|
||||
~ProcessManager();
|
||||
|
||||
void add_process(Process&&);
|
||||
Optional<Process> remove_process(pid_t);
|
||||
Optional<Process&> find_process(pid_t);
|
||||
|
||||
#if defined(AK_OS_MACH)
|
||||
void set_process_mach_port(pid_t, Core::MachPort&&);
|
||||
#endif
|
||||
|
||||
void update_all_process_statistics();
|
||||
String generate_html();
|
||||
|
||||
Function<void(Process&&)> on_process_exited;
|
||||
|
||||
private:
|
||||
Core::Platform::ProcessStatistics m_statistics;
|
||||
HashMap<pid_t, Process> m_processes;
|
||||
int m_signal_handle { -1 };
|
||||
Threading::Mutex m_lock;
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue