1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 // The entries in this file define support functions for each of the process
8 // types present in Gecko. The format is:
10 // GECKO_PROCESS_TYPE(enum-value, enum-name, string-name, proc-typename,
13 // enum-value: Unsigned int value the enum will use to identify the process
14 // type. This value must not be shared by different process types and should
15 // never be changed since it is used e.g. in telemetry reporting. These
16 // values should be mirrored in nsIXULRuntime.idl.
18 // enum-name: used to name the GeckoChildProcess enum. E.g. `Foo` will
19 // become `GeckoChildProcess_Foo`. The enum's value will be the enum-value
22 // string-name: Human-readable name. It is exposed to things like
23 // telemetry and the crash reporter, so it should not be changed casually.
25 // proc-typename: Used as NAME in the `XRE_Is${NAME}Process` function.
26 // Ideally, this should match the enum-name. This is included since there
27 // are legacy exceptions to that rule.
29 // process-bin-type: either Self or PluginContainer. Determines
30 // whether the child process may be started using the same binary as the parent
31 // process, or whether to use plugin-container (Note that whether or not this
32 // value is actually obeyed depends on platform and build configuration. Do not
33 // use this value directly, but rather use XRE_GetChildProcBinPathType to
36 GECKO_PROCESS_TYPE(0, Default
, "default", Parent
, Self
)
37 GECKO_PROCESS_TYPE(2, Content
, "tab", Content
, Self
)
38 GECKO_PROCESS_TYPE(3, IPDLUnitTest
, "ipdlunittest", IPDLUnitTest
,
40 // Gecko Media Plugin process.
41 GECKO_PROCESS_TYPE(4, GMPlugin
, "gmplugin", GMPlugin
, PluginContainer
)
42 // GPU and compositor process.
43 GECKO_PROCESS_TYPE(5, GPU
, "gpu", GPU
, Self
)
45 GECKO_PROCESS_TYPE(6, VR
, "vr", VR
, Self
)
46 // Remote Data Decoder process.
47 GECKO_PROCESS_TYPE(7, RDD
, "rdd", RDD
, Self
)
49 GECKO_PROCESS_TYPE(8, Socket
, "socket", Socket
, Self
)
50 GECKO_PROCESS_TYPE(9, RemoteSandboxBroker
, "sandboxbroker", RemoteSandboxBroker
,
52 GECKO_PROCESS_TYPE(10, ForkServer
, "forkserver", ForkServer
, Self
)
54 // Please add new process types at the end of this list. You will also need
55 // to maintain consistency with:
57 // * toolkit/components/processtools/ProcInfo.h (ProcType),
58 // * xpcom/system/nsIXULRuntime.idl (PROCESS_TYPE constants),
59 // * toolkit/xre/nsAppRunner.cpp (SYNC_ENUMS),
60 // * dom/base/ChromeUtils.cpp (ProcTypeToWebIDL and
61 // ChromeUtils::RequestProcInfo)
62 // * dom/chrome-webidl/ChromeUtils.webidl (WebIDLProcType)
63 // * toolkit/components/crashes/nsICrashService.idl and
64 // CrashService.jsm (PROCESS_TYPE constants)
65 // * ipc/glue/CrashReporterHost.cpp (assertions)
66 // * toolkit/locales/en-US/toolkit/global/processTypes.ftl and
67 // toolkit/modules/ProcessType.jsm
69 // Also, please ensure that any new sandbox environment variables are added
70 // in build/pgo/profileserver.py to ensure your new process participates in
71 // PGO profile generation.