diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /xpcom/geckoprocesstypes_generator | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'xpcom/geckoprocesstypes_generator')
3 files changed, 225 insertions, 0 deletions
diff --git a/xpcom/geckoprocesstypes_generator/geckoprocesstypes/__init__.py b/xpcom/geckoprocesstypes_generator/geckoprocesstypes/__init__.py new file mode 100644 index 0000000000..9b5b3cb8a1 --- /dev/null +++ b/xpcom/geckoprocesstypes_generator/geckoprocesstypes/__init__.py @@ -0,0 +1,203 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +from collections import namedtuple + +# Please make sure you follow ipc/docs/processes.rst and keep updating all +# places that might depend on a new process type and that are not covered (yet) +# by that code. + +# The entries in this file define support functions for each of the process +# types present in Gecko. +# +# GECKO_PROCESS_TYPE( +# enum-value, +# enum-name, +# string-name, +# proc-typename, +# process-bin-type, +# procinfo-typename, +# webidl-typename, +# allcaps-name, +# crash-ping, +# ) +# +# enum-value: +# Unsigned int value the enum will use to identify the process type. This +# value must not be shared by different process types and should never be +# changed since it is used e.g. in telemetry reporting. +# +# ***These values should be mirrored in nsIXULRuntime.idl.*** +# +# enum-name: +# Used to name the GeckoChildProcess enum. E.g. `Foo` will become +# `GeckoChildProcess_Foo`. The enum's value will be the enum-value above. +# +# string-name: +# Human-readable name. It is exposed to things like telemetry and the crash +# reporter, so it should not be changed casually. +# +# proc-typename: +# Used as NAME in the `XRE_Is${NAME}Process` function. Ideally, this should +# match the enum-name. This is included since there are legacy exceptions to +# that rule. +# +# process-bin-type: +# Either Self or PluginContainer. Determines whether the child process may +# be started using the same binary as the parent process, or whether to use +# plugin-container (Note that whether or not this value is actually obeyed +# depends on platform and build configuration. Do not use this value +# directly, but rather use XRE_GetChildProcBinPathType to resolve this). +# +# procinfo-typename: +# Used as NAME in the ProcType enum defined by ProcInfo.h. +# +# webidl-typename: +# Used as NAME in the ChromeUtils.cpp code +# +# allcaps-name: +# Used as NAME for checking SYNC_ENUM in nsXULAppAPI.h +# +# crash-ping: +# Boolean reflecting if the process is allowed to send crash ping. + + +GeckoProcessType = namedtuple( + "GeckoProcessType", + [ + "enum_value", + "enum_name", + "string_name", + "proc_typename", + "process_bin_type", + "procinfo_typename", + "webidl_typename", + "allcaps_name", + "crash_ping", + ], +) + +process_types = [ + GeckoProcessType( + 0, + "Default", + "default", + "Parent", + "Self", + "Browser", + "Browser", + "DEFAULT", + True, + ), + GeckoProcessType( + 2, + "Content", + "tab", + "Content", + "Self", + "Content", + "Content", + "CONTENT", + True, + ), + GeckoProcessType( + 3, + "IPDLUnitTest", + "ipdlunittest", + "IPDLUnitTest", + "Self", + "IPDLUnitTest", + "IpdlUnitTest", + "IPDLUNITTEST", + False, + ), + GeckoProcessType( + 4, + "GMPlugin", + "gmplugin", + "GMPlugin", + "PluginContainer", + "GMPlugin", + "GmpPlugin", + "GMPLUGIN", + True, + ), + GeckoProcessType( + 5, + "GPU", + "gpu", + "GPU", + "Self", + "GPU", + "Gpu", + "GPU", + True, + ), + GeckoProcessType( + 6, + "VR", + "vr", + "VR", + "Self", + "VR", + "Vr", + "VR", + True, + ), + GeckoProcessType( + 7, + "RDD", + "rdd", + "RDD", + "Self", + "RDD", + "Rdd", + "RDD", + True, + ), + GeckoProcessType( + 8, + "Socket", + "socket", + "Socket", + "Self", + "Socket", + "Socket", + "SOCKET", + True, + ), + GeckoProcessType( + 9, + "RemoteSandboxBroker", + "sandboxbroker", + "RemoteSandboxBroker", + "PluginContainer", + "RemoteSandboxBroker", + "RemoteSandboxBroker", + "REMOTESANDBOXBROKER", + True, + ), + GeckoProcessType( + 10, + "ForkServer", + "forkserver", + "ForkServer", + "Self", + "ForkServer", + "ForkServer", + "FORKSERVER", + True, + ), + GeckoProcessType( + 11, + "Utility", + "utility", + "Utility", + "Self", + "Utility", + "Utility", + "UTILITY", + True, + ), +] diff --git a/xpcom/geckoprocesstypes_generator/geckoprocesstypes/moz.build b/xpcom/geckoprocesstypes_generator/geckoprocesstypes/moz.build new file mode 100644 index 0000000000..568f361a54 --- /dev/null +++ b/xpcom/geckoprocesstypes_generator/geckoprocesstypes/moz.build @@ -0,0 +1,5 @@ +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. diff --git a/xpcom/geckoprocesstypes_generator/setup.py b/xpcom/geckoprocesstypes_generator/setup.py new file mode 100644 index 0000000000..9fd8dff82d --- /dev/null +++ b/xpcom/geckoprocesstypes_generator/setup.py @@ -0,0 +1,17 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +from setuptools import find_packages, setup + +setup( + name="geckoprocesstypes", + version="1.0", + description="Generator for GeckoProcessTypes related resources.", + author="Mozilla Foundation", + license="MPL 2.0", + packages=find_packages(), + install_requires=[], + entry_points={"console_scripts": ["GeckoProcessTypes.py = geckoprocesstypes:main"]}, + keywords=["geckoprocesstypes"], +) |