no bug - Bumping Firefox l10n changesets r=release a=l10n-bump DONTBUILD CLOSED TREE
[gecko.git] / xpcom / components / Module.h
blobb8fae643569333fd9a7831ce8b6bd1477bed57a6
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 #ifndef mozilla_Module_h
8 #define mozilla_Module_h
10 #include "nscore.h"
12 namespace mozilla {
14 namespace Module {
15 /**
16 * This selector allows components to be marked so that they're only loaded
17 * into certain kinds of processes. Selectors can be combined.
19 // Note: This must be kept in sync with the selector matching in
20 // nsComponentManager.cpp.
21 enum ProcessSelector {
22 ANY_PROCESS = 0,
23 MAIN_PROCESS_ONLY = 1 << 0,
24 CONTENT_PROCESS_ONLY = 1 << 1,
26 /**
27 * By default, modules are not loaded in the GPU, VR, Socket, RDD, Utility,
28 * GMPlugin and IPDLUnitTest processes, even if ANY_PROCESS is specified.
29 * This flag enables a module in the relevant process.
31 * NOTE: IPDLUnitTest does not have its own flag, and will only load a
32 * module if it is enabled in all processes.
34 ALLOW_IN_GPU_PROCESS = 1 << 2,
35 ALLOW_IN_VR_PROCESS = 1 << 3,
36 ALLOW_IN_SOCKET_PROCESS = 1 << 4,
37 ALLOW_IN_RDD_PROCESS = 1 << 5,
38 ALLOW_IN_UTILITY_PROCESS = 1 << 6,
39 ALLOW_IN_GMPLUGIN_PROCESS = 1 << 7,
40 ALLOW_IN_GPU_AND_MAIN_PROCESS = ALLOW_IN_GPU_PROCESS | MAIN_PROCESS_ONLY,
41 ALLOW_IN_GPU_AND_VR_PROCESS = ALLOW_IN_GPU_PROCESS | ALLOW_IN_VR_PROCESS,
42 ALLOW_IN_GPU_AND_SOCKET_PROCESS =
43 ALLOW_IN_GPU_PROCESS | ALLOW_IN_SOCKET_PROCESS,
44 ALLOW_IN_GPU_VR_AND_SOCKET_PROCESS =
45 ALLOW_IN_GPU_PROCESS | ALLOW_IN_VR_PROCESS | ALLOW_IN_SOCKET_PROCESS,
46 ALLOW_IN_RDD_AND_SOCKET_PROCESS =
47 ALLOW_IN_RDD_PROCESS | ALLOW_IN_SOCKET_PROCESS,
48 ALLOW_IN_GPU_RDD_AND_SOCKET_PROCESS =
49 ALLOW_IN_GPU_PROCESS | ALLOW_IN_RDD_PROCESS | ALLOW_IN_SOCKET_PROCESS,
50 ALLOW_IN_GPU_RDD_SOCKET_AND_UTILITY_PROCESS =
51 ALLOW_IN_GPU_PROCESS | ALLOW_IN_RDD_PROCESS | ALLOW_IN_SOCKET_PROCESS,
52 ALLOW_IN_GPU_RDD_VR_AND_SOCKET_PROCESS =
53 ALLOW_IN_GPU_PROCESS | ALLOW_IN_RDD_PROCESS | ALLOW_IN_VR_PROCESS |
54 ALLOW_IN_SOCKET_PROCESS,
55 ALLOW_IN_GPU_RDD_VR_SOCKET_AND_UTILITY_PROCESS =
56 ALLOW_IN_GPU_PROCESS | ALLOW_IN_RDD_PROCESS | ALLOW_IN_VR_PROCESS |
57 ALLOW_IN_SOCKET_PROCESS | ALLOW_IN_UTILITY_PROCESS,
58 ALLOW_IN_GPU_RDD_VR_SOCKET_UTILITY_AND_GMPLUGIN_PROCESS =
59 ALLOW_IN_GPU_PROCESS | ALLOW_IN_RDD_PROCESS | ALLOW_IN_VR_PROCESS |
60 ALLOW_IN_SOCKET_PROCESS | ALLOW_IN_UTILITY_PROCESS |
61 ALLOW_IN_GMPLUGIN_PROCESS
64 static constexpr size_t kMaxProcessSelector = size_t(
65 ProcessSelector::ALLOW_IN_GPU_RDD_VR_SOCKET_UTILITY_AND_GMPLUGIN_PROCESS);
67 /**
68 * This allows category entries to be marked so that they are or are
69 * not loaded when in backgroundtask mode.
71 // Note: This must be kept in sync with the selector matching in
72 // StaticComponents.cpp.in.
73 enum BackgroundTasksSelector {
74 NO_TASKS = 0x0,
75 ALL_TASKS = 0xFFFF,
77 }; // namespace Module
79 } // namespace mozilla
81 #endif // mozilla_Module_h