Bug 1837620 - Part 1: Remove baseline ICs that guard shapes when the shape becomes...
[gecko.git] / xpcom / system / nsIXULRuntime.idl
blobe679bf74c5d5073ff7e98ef937620f2384aef949
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #include "nsISupports.idl"
7 %{C++
9 namespace mozilla {
10 // Simple C++ getter for nsIXULRuntime::browserTabsRemoteAutostart
11 // This getter is a temporary function that checks for special
12 // conditions in which e10s support is not great yet, and should
13 // therefore be disabled. Bug 1065561 tracks its removal.
14 bool BrowserTabsRemoteAutostart();
15 uint32_t GetMaxWebProcessCount();
17 // Returns the value of the fission.autostart pref. Since fission can be
18 // disabled on a per-window basis, this should only be used when you need the
19 // global value of the pref. For other use cases, you should use
20 // nsILoadContext::UseRemoteSubframes instead. This will also check for special
21 // conditions, like safe mode, which may require fission to be disabled, or
22 // environment variables MOZ_FORCE_ENABLE_FISSION and MOZ_FORCE_DISABLE_FISSION,
23 // used by mach run to enable/disable fission regardless of pref settings.
24 bool FissionAutostart();
26 // Returns whether or not we are currently enrolled in the fission experiment.
27 bool FissionExperimentEnrolled();
29 // Returns true if FissionAutostart() is true or
30 // fission.disableSessionHistoryInParent is false.
31 bool SessionHistoryInParent();
33 // Returns true if SessionHistoryInParent() returns true and
34 // fission.bfcacheInParent is true.
35 bool BFCacheInParent();
40 /**
41 * Provides information about the XUL runtime.
42 * @status UNSTABLE - This interface is not frozen and will probably change in
43 * future releases. If you need this functionality to be
44 * stable/frozen, please contact Benjamin Smedberg.
47 [scriptable, uuid(03602fac-fa3f-4a50-9baa-b88456fb4a0f)]
48 interface nsIXULRuntime : nsISupports
50 /**
51 * Whether the application was launched in safe mode.
53 readonly attribute boolean inSafeMode;
55 /**
56 * The status of a given normandy experiment.
58 cenum ExperimentStatus : 8 {
59 // The user is not actively enrolled in the experiment.
60 eExperimentStatusUnenrolled = 0,
61 // The user is enrolled in the control group, and should see the default
62 // behavior.
63 eExperimentStatusControl = 1,
64 // The user is enrolled in the treatment group, and should see the
65 // experimental behavior which is being tested.
66 eExperimentStatusTreatment = 2,
67 // The user was enrolled in the experiment, but became ineligible due to
68 // manually modifying a relevant preference.
69 eExperimentStatusDisqualified = 3,
70 // The user was selected for the phased Fission rollout.
71 eExperimentStatusRollout = 4,
73 eExperimentStatusCount,
76 // If you update this enum, don't forget to raise the limit in
77 // TelemetryEnvironmentTesting.sys.mjs and record the new value in
78 // environment.rst
79 cenum ContentWin32kLockdownState : 8 {
80 LockdownEnabled = 1, // no longer used
81 MissingWebRender = 2,
82 OperatingSystemNotSupported = 3,
83 PrefNotSet = 4, // no longer used
84 MissingRemoteWebGL = 5,
85 MissingNonNativeTheming = 6,
86 DisabledByEnvVar = 7, // - MOZ_ENABLE_WIN32K is set
87 DisabledBySafeMode = 8,
88 DisabledByE10S = 9, // - E10S is disabled for whatever reason
89 DisabledByUserPref = 10, // - The user manually set
90 // security.sandbox.content.win32k-disable to false
91 EnabledByUserPref = 11, // The user manually set
92 // security.sandbox.content.win32k-disable to true
93 DisabledByControlGroup =
94 12, // The user is in the Control Group, so it is disabled
95 EnabledByTreatmentGroup =
96 13, // The user is in the Treatment Group, so it is enabled
97 DisabledByDefault = 14, // The default value of the pref is false
98 EnabledByDefault = 15, // The default value of the pref is true
99 DecodersArentRemote = 16,
100 IncompatibleMitigationPolicy = 17, // Some incompatible Windows Exploit Mitigation policies are enabled
103 // This is the current value of the experiment for the session
104 readonly attribute nsIXULRuntime_ExperimentStatus win32kExperimentStatus;
105 // This will return what the browser thinks is the _current_ status of win32k lockdown
106 // but this should only be used for testing
107 readonly attribute nsIXULRuntime_ContentWin32kLockdownState win32kLiveStatusTestingOnly;
108 // This is the current value of win32k lockdown for the session. It is set at startup,
109 // and never changed.
110 readonly attribute nsIXULRuntime_ContentWin32kLockdownState win32kSessionStatus;
112 // NOTE: Please do not add new values to this enum without also updating the
113 // mapping in aboutSupport.js
114 cenum FissionDecisionStatus : 8 {
115 eFissionStatusUnknown = 0,
116 // Fission is disabled because the user is in the control group of a
117 // Normandy experiment.
118 eFissionExperimentControl = 1,
119 // Fission is enabled because the user is in the treatment group of a
120 // Normandy experiment.
121 eFissionExperimentTreatment = 2,
122 // Fission is disabled because the `MOZ_FORCE_DISABLE_E10S` environment
123 // variable is set.
124 eFissionDisabledByE10sEnv = 3,
125 // Fission is enabled because the `MOZ_FORCE_ENABLE_FISSION` environment
126 // variable is set.
127 eFissionEnabledByEnv = 4,
128 // Fission is disabled because the `MOZ_FORCE_DISABLE_FISSION` environment
129 // variable is set.
130 eFissionDisabledByEnv = 5,
131 // Fission is enabled because the "fission.autostart" preference is true
132 // by default.
133 eFissionEnabledByDefault = 7,
134 // Fission is disabled because the "fission.autostart" preference is false
135 // by default.
136 eFissionDisabledByDefault = 8,
137 // Fission is enabled because the "fission.autostart" preference was
138 // turned on by the user.
139 eFissionEnabledByUserPref = 9,
140 // Fission is enabled because the "fission.autostart" preference was
141 // turned on by the user.
142 eFissionDisabledByUserPref = 10,
143 // Fission is disabled because e10s is disabled for some other reason.
144 eFissionDisabledByE10sOther = 11,
145 // Fission is enabled by a Normandy phased rollout.
146 eFissionEnabledByRollout = 12,
150 * Whether Fission should be automatically enabled for new browser windows.
151 * This may not match the value of the 'fission.autostart' pref.
153 * This value is guaranteed to remain constant for the length of a browser
154 * session.
156 readonly attribute boolean fissionAutostart;
159 * The deciding factor which caused Fission to be enabled or disabled in
160 * this session. The string version is the same of the name of the constant,
161 * without the leading `eFission`, and with an initial lower-case letter.
163 readonly attribute nsIXULRuntime_FissionDecisionStatus fissionDecisionStatus;
164 readonly attribute ACString fissionDecisionStatusString;
167 * Whether session history is stored in the parent process.
169 readonly attribute boolean sessionHistoryInParent;
172 * Whether to write console errors to a log file. If a component
173 * encounters startup errors that might prevent the app from showing
174 * proper UI, it should set this flag to "true".
176 attribute boolean logConsoleErrors;
179 * A string tag identifying the current operating system. This is taken
180 * from the OS_TARGET configure variable. It will always be available.
182 readonly attribute AUTF8String OS;
185 * A string tag identifying the binary ABI of the current processor and
186 * compiler vtable. This is taken from the TARGET_XPCOM_ABI configure
187 * variable. It may not be available on all platforms, especially
188 * unusual processor or compiler combinations.
190 * The result takes the form <processor>-<compilerABI>, for example:
191 * x86-msvc
192 * ppc-gcc3
194 * This value should almost always be used in combination with "OS".
196 * @throw NS_ERROR_NOT_AVAILABLE if not available.
198 readonly attribute AUTF8String XPCOMABI;
201 * A string tag identifying the target widget toolkit in use.
202 * This is taken from the MOZ_WIDGET_TOOLKIT configure variable.
204 readonly attribute AUTF8String widgetToolkit;
207 * The legal values of processType.
209 const unsigned long PROCESS_TYPE_DEFAULT = 0;
210 const unsigned long PROCESS_TYPE_CONTENT = 2;
211 const unsigned long PROCESS_TYPE_IPDLUNITTEST = 3;
212 const unsigned long PROCESS_TYPE_GMPLUGIN = 4;
213 const unsigned long PROCESS_TYPE_GPU = 5;
214 const unsigned long PROCESS_TYPE_VR = 6;
215 const unsigned long PROCESS_TYPE_RDD = 7;
216 const unsigned long PROCESS_TYPE_SOCKET = 8;
217 const unsigned long PROCESS_TYPE_REMOTESANDBOXBROKER = 9;
218 const unsigned long PROCESS_TYPE_FORKSERVER = 10;
219 const unsigned long PROCESS_TYPE_UTILITY = 11;
222 * The type of the caller's process. Returns one of the values above.
224 readonly attribute unsigned long processType;
227 * The system process ID of the caller's process.
229 readonly attribute unsigned long processID;
232 * A globally unique and non-recycled ID of the caller's process.
234 readonly attribute uint64_t uniqueProcessID;
237 * The type of remote content process we're running in.
238 * null if we're in the parent/chrome process. This can contain
239 * a URI if Fission is enabled, so don't use it for any kind of
240 * telemetry.
242 readonly attribute AUTF8String remoteType;
245 * If true, browser tabs may be opened by default in a different process
246 * from the main browser UI.
248 readonly attribute boolean browserTabsRemoteAutostart;
251 * Returns the number of content processes to use for normal web pages. If
252 * this value is > 1, then e10s-multi should be considered to be "on".
254 * NB: If browserTabsRemoteAutostart is false, then this value has no
255 * meaning and e10s should be considered to be "off"!
257 readonly attribute uint32_t maxWebProcessCount;
260 * The current e10s-multi experiment number. Set dom.ipc.multiOptOut to (at
261 * least) this to disable it until the next experiment.
263 const uint32_t E10S_MULTI_EXPERIMENT = 1;
266 * If true, the accessibility service is running.
268 readonly attribute boolean accessibilityEnabled;
271 * Executable of Windows service that activated accessibility.
273 readonly attribute AString accessibilityInstantiator;
276 * Indicates whether the current Firefox build is 64-bit.
278 readonly attribute boolean is64Bit;
281 * Indicates whether or not text recognition of images supported by the OS.
283 readonly attribute boolean isTextRecognitionSupported;
286 * Signal the apprunner to invalidate caches on the next restart.
287 * This will cause components to be autoregistered and all
288 * fastload data to be re-created.
290 void invalidateCachesOnRestart();
293 * Starts a child process. This method is intented to pre-start a
294 * content child process so that when it is actually needed, it is
295 * ready to go.
297 * @throw NS_ERROR_NOT_AVAILABLE if not available.
299 void ensureContentProcess();
302 * Modification time of the profile lock before the profile was locked on
303 * this startup. Used to know the last time the profile was used and not
304 * closed cleanly. This is set to 0 if there was no existing profile lock.
306 readonly attribute PRTime replacedLockTime;
309 * The default update channel (MOZ_UPDATE_CHANNEL).
311 readonly attribute AUTF8String defaultUpdateChannel;
314 * The distribution ID for this build (MOZ_DISTRIBUTION_ID).
316 readonly attribute AUTF8String distributionID;
319 * True if Windows DLL blocklist initialized correctly. This is
320 * primarily for automated testing purposes.
322 readonly attribute boolean windowsDLLBlocklistStatus;
325 * True if this application was started by the OS as part of an automatic
326 * restart mechanism (such as RegisterApplicationRestart on Windows).
328 readonly attribute boolean restartedByOS;
330 /** Whether the chrome color-scheme is dark */
331 readonly attribute boolean chromeColorSchemeIsDark;
333 /** Whether the content color-scheme derived from the app theme is dark */
334 readonly attribute boolean contentThemeDerivedColorSchemeIsDark;
336 /** Whether the user prefers reduced motion */
337 readonly attribute boolean prefersReducedMotion;
339 /** Whether we should draw over the titlebar */
340 readonly attribute boolean drawInTitlebar;
342 /** Returns the desktop environment identifier. Only meaningful on GTK */
343 readonly attribute ACString desktopEnvironment;
346 * The path of the shortcut used to start the current process, or "" if none.
348 * Windows Main process only, otherwise throws NS_ERROR_NOT_AVAILABLE
350 * May be mising in some cases where the user did launch from a shortcut:
351 * - If the updater ran on startup
352 * - If the AUMID was set before the shortcut could be saved
354 * @throw NS_ERROR_NOT_AVAILABLE if not available.
356 readonly attribute AString processStartupShortcut;
359 * Returns a value corresponding to one of the
360 * |mozilla::LauncherRegistryInfo::EnabledState| values.
362 readonly attribute uint32_t launcherProcessState;
365 * Returns the last application version that used the current profile or null
366 * if the last version could not be found (compatibility.ini was either
367 * missing or invalid). Throws NS_ERROR_UNAVAILABLE if called from a content
368 * process.
370 readonly attribute ACString lastAppVersion;
373 * Returns the last application build ID that used the current profile or null
374 * if the last build ID could not be found (compatibility.ini was either
375 * missing or invalid). Throws NS_ERROR_UNAVAILABLE if called from a content
376 * process.
378 readonly attribute ACString lastAppBuildID;
382 %{C++
384 namespace mozilla {
386 nsIXULRuntime::ContentWin32kLockdownState GetWin32kLockdownState();