mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-03 16:16:43 +00:00
LibCore+LibWebView: Move process statistics to LibCore
This will be needed to collect statistics from processes that do not have anything to do with LibWebView. The ProcessInfo structure must be virtual to allow callers to add application-specific information.
This commit is contained in:
parent
ac594fae5e
commit
5dd3b91f0e
Notes:
sideshowbarker
2024-07-16 19:42:24 +09:00
Author: https://github.com/trflynn89
Commit: 5dd3b91f0e
Pull-request: https://github.com/SerenityOS/serenity/pull/24074
Reviewed-by: https://github.com/ADKaster ✅
17 changed files with 176 additions and 126 deletions
39
Userland/Libraries/LibWebView/ProcessInfo.h
Normal file
39
Userland/Libraries/LibWebView/ProcessInfo.h
Normal file
|
@ -0,0 +1,39 @@
|
|||
/*
|
||||
* Copyright (c) 2024, Andrew Kaster <akaster@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Types.h>
|
||||
#include <LibCore/Platform/ProcessInfo.h>
|
||||
|
||||
#if defined(AK_OS_MACH)
|
||||
# include <LibCore/MachPort.h>
|
||||
#endif
|
||||
|
||||
namespace WebView {
|
||||
|
||||
enum class ProcessType {
|
||||
Chrome,
|
||||
WebContent,
|
||||
WebWorker,
|
||||
SQLServer,
|
||||
RequestServer,
|
||||
ImageDecoder,
|
||||
};
|
||||
|
||||
struct ProcessInfo : public Core::Platform::ProcessInfo {
|
||||
using Core::Platform::ProcessInfo::ProcessInfo;
|
||||
|
||||
ProcessInfo(ProcessType type, pid_t pid)
|
||||
: Core::Platform::ProcessInfo(pid)
|
||||
, type(type)
|
||||
{
|
||||
}
|
||||
|
||||
ProcessType type { ProcessType::WebContent };
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue