1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
4 * You can obtain one at http://mozilla.org/MPL/2.0/.
7 interface nsIDOMProcessChild;
8 interface nsIDOMProcessParent;
12 * An optimized QueryInterface method, generated by generateQI.
14 * For JS callers, this behaves like a normal QueryInterface function. When
15 * called with a supported interface, it returns its `this` object. When
16 * called with an unsupported interface, it throws NS_ERROR_NO_INTERFACE.
18 * C++ callers use a fast path, and never call the JSAPI or WebIDL methods of
21 [ChromeOnly, Exposed=Window]
22 interface MozQueryInterface {
24 legacycaller any (any aIID);
28 * Options for a marker created with the addProfilerMarker method.
29 * All fields are optional.
31 dictionary ProfilerMarkerOptions {
32 // A timestamp to use as the start time of the marker.
33 // If no start time is provided, the marker will have no duration.
34 // In window and ChromeWorker contexts, use a timestamp from
35 // `performance.now()`.
36 // In JS modules, use `Cu.now()` to get a timestamp.
37 DOMHighResTimeStamp startTime = 0;
39 // If captureStack is true, a profiler stack will be captured and associated
41 boolean captureStack = false;
43 // Markers are created by default in the JavaScript category, but this can be
45 // Examples of correct values: "JavaScript", "Test", "Other", ...
46 // See ProfilingCategoryList.h for the complete list of valid values.
47 // Using an unrecognized value will set the category to "Other".
48 ByteString category = "JavaScript";
50 // Inner window ID to use for the marker. If the global object is a window,
51 // the inner window id of the marker will be set automatically.
52 // If a marker that relates to a specific window is added from a JS module,
53 // setting the inner window id will allow the profiler to show which window
54 // the marker applies to.
55 unsigned long long innerWindowId = 0;
58 dictionary InteractionData {
59 unsigned long interactionCount = 0;
60 unsigned long interactionTimeInMilliseconds = 0;
61 unsigned long scrollingDistanceInPixels = 0;
65 * Confidence value of credit card fields. This is used by the native
66 * Fathom Credit Card model to return the score to JS.
68 dictionary FormAutofillConfidences {
74 * A collection of static utility methods that are only exposed to system code.
75 * This is exposed in all the system globals where we can expose stuff by
76 * default, so should only include methods that are **thread-safe**.
78 [ChromeOnly, Exposed=(Window,Worker)]
79 namespace ChromeUtils {
81 * Get the |NodeId| for the given JS Object.
82 * |NodeId| is the identifier of |JS::ubi::Node|.
84 NodeId getObjectNodeId(object obj);
87 * Serialize a snapshot of the heap graph, as seen by |JS::ubi::Node| and
88 * restricted by |boundaries|, and write it to the provided file path.
90 * @param boundaries The portion of the heap graph to write.
92 * @returns The path to the file the heap snapshot was written
93 * to. This is guaranteed to be within the temp
94 * directory and its file name will match the regexp
95 * `\d+(\-\d+)?\.fxsnapshot`.
98 DOMString saveHeapSnapshot(optional HeapSnapshotBoundaries boundaries = {});
101 * This is the same as saveHeapSnapshot, but with a different return value.
103 * @returns The snapshot ID of the file. This is the file name
104 * without the temp directory or the trailing
108 DOMString saveHeapSnapshotGetId(optional HeapSnapshotBoundaries boundaries = {});
111 * Deserialize a core dump into a HeapSnapshot.
113 * @param filePath The file path to read the heap snapshot from.
116 HeapSnapshot readHeapSnapshot(DOMString filePath);
119 * Efficient way to know if DevTools are active in the current process.
121 * This doesn't help know what particular context is being debugged,
122 * but can help strip off code entirely when DevTools aren't used at all.
124 * BrowsingContext.isWatchedByDevTools is a more precise way to know
125 * when one precise tab is being debugged.
127 boolean isDevToolsOpened();
130 * API exposed to DevTools JS code in order to know when devtools are being active in the current process.
132 * This API counts the number of calls to these methods, allowing to track many DevTools instances.
134 undefined notifyDevToolsOpened();
135 undefined notifyDevToolsClosed();
139 * Return the keys in a weak map. This operation is
140 * non-deterministic because it is affected by the scheduling of the
141 * garbage collector and the cycle collector.
143 * @param aMap weak map or other JavaScript value
144 * @returns If aMap is a weak map object, return the keys of the weak
145 * map as an array. Otherwise, return undefined.
148 any nondeterministicGetWeakMapKeys(any map);
151 * Return the keys in a weak set. This operation is
152 * non-deterministic because it is affected by the scheduling of the
153 * garbage collector and the cycle collector.
155 * @param aSet weak set or other JavaScript value
156 * @returns If aSet is a weak set object, return the keys of the weak
157 * set as an array. Otherwise, return undefined.
160 any nondeterministicGetWeakSetKeys(any aSet);
163 * Converts a buffer to a Base64 URL-encoded string per RFC 4648.
165 * @param source The buffer to encode.
166 * @param options Additional encoding options.
167 * @returns The encoded string.
170 ByteString base64URLEncode(BufferSource source,
171 Base64URLEncodeOptions options);
174 * Decodes a Base64 URL-encoded string per RFC 4648.
176 * @param string The string to decode.
177 * @param options Additional decoding options.
178 * @returns The decoded buffer.
181 ArrayBuffer base64URLDecode(ByteString string,
182 Base64URLDecodeOptions options);
185 * Cause the current process to fatally crash unless the given condition is
186 * true. This is similar to MOZ_RELEASE_ASSERT in C++ code.
188 * WARNING: This message is included publicly in the crash report, and must
189 * not contain private information.
191 * Crash report will be augmented with the current JS stack information.
193 undefined releaseAssert(boolean condition,
194 optional DOMString message = "<no message>");
199 * If the chrome code has thrown a JavaScript Dev Error
200 * in the current JSRuntime. the first such error, or `undefined`
203 * A JavaScript Dev Error is an exception thrown by JavaScript
204 * code that matches both conditions:
205 * - it was thrown by chrome code;
206 * - it is either a `ReferenceError`, a `TypeError` or a `SyntaxError`.
208 * Such errors are stored regardless of whether they have been
211 * This mechanism is designed to help ensure that the code of
212 * Firefox is free from Dev Errors, even if they are accidentally
215 * The object returned is not an exception. It has fields:
217 * - DOMString filename
218 * - DOMString lineNumber
219 * - DOMString message
222 readonly attribute any recentJSDevError;
225 * Reset `recentJSDevError` to `undefined` for the current JSRuntime.
227 undefined clearRecentJSDevError();
228 #endif // NIGHTLY_BUILD
231 * Clears the stylesheet cache by baseDomain. This includes associated
232 * state-partitioned cache.
234 undefined clearStyleSheetCacheByBaseDomain(UTF8String baseDomain);
237 * Clears the stylesheet cache by principal.
239 undefined clearStyleSheetCacheByPrincipal(Principal principal);
242 * Clears the entire stylesheet cache.
244 undefined clearStyleSheetCache();
247 * If the profiler is currently running and recording the current thread,
248 * add a marker for the current thread. No-op otherwise.
250 * @param name The name of the marker.
251 * @param options Either a timestamp to use as the start time of the
252 * marker, or a ProfilerMarkerOptions object that can
253 * contain startTime, captureStack or category fields.
254 * If this parameter is omitted, the marker will have
256 * In window and ChromeWorker contexts, use a
257 * timestamp from `performance.now()`.
258 * In JS modules, use `Cu.now()` to get a timestamp.
259 * @param text Text to associate with the marker.
261 undefined addProfilerMarker(UTF8String name,
262 optional (ProfilerMarkerOptions or DOMHighResTimeStamp) options = {},
263 optional UTF8String text);
266 * Return the symbolic name of any given XPCOM error code (nsresult):
267 * "NS_OK", "NS_ERROR_FAILURE",...
269 UTF8String getXPCOMErrorName(unsigned long aErrorCode);
272 * Return a fractional number representing the current time (in milliseconds from the Epoch).
273 * Should be JS_Now()/1000 so that it can be compared to Date.now in Javascript.
278 * Defines a getter on a specified object that will be created upon first
282 * The object to define the lazy getter on.
284 * The name of the getter to define on aTarget.
286 * A function that returns what the getter should return. This will
287 * only ever be called once.
290 undefined defineLazyGetter(object aTarget, any aName, object aLambda);
295 * Return platform-specific libc constants, such as errno values.
297 LibcConstants getLibcConstants();
302 * Returns the information about all Media Foundation based content decryption
303 * modules, which would include key system names and their capabilities.
306 Promise<sequence<CDMInformation>> getWMFContentDecryptionModuleInformation();
310 * Returns the information about the GMP based content decryption
311 * modules, which would include key system names and their capabilities.
314 Promise<sequence<CDMInformation>> getGMPContentDecryptionModuleInformation();
317 * Synchronously loads and evaluates the JS module source located at
320 * @param aResourceURI A resource:// URI string to load the module from.
321 * @param aOption An option to specify where to load the module into.
322 * @returns the module's namespace object.
324 * The implementation maintains a hash of aResourceURI->global obj.
325 * Subsequent invocations of import with 'aResourceURI' pointing to
326 * the same file will not cause the module to be re-evaluated.
328 * In worker threads, aOption is required and only { global: "current" } and
329 * { global: "contextual" } are supported.
331 * In DevTools distinct global, aOptions.global is reuiqred.
334 object importESModule(DOMString aResourceURI,
335 optional ImportESModuleOptionsDictionary aOptions = {});
338 * Defines propertys on the given target which lazily imports a ES module
341 * @param aTarget The target object on which to define the property.
342 * @param aModules An object with a property for each module property to be
343 * imported, where the property name is the name of the
344 * imported symbol and the value is the module URI.
345 * @param aOption An option to specify where to load the module into.
347 * In worker threads, aOption is required and only { global: "current" } and
348 * { global: "contextual" } are supported.
350 * In DevTools distinct global, aOptions.global is reuiqred.
353 undefined defineESModuleGetters(object aTarget, object aModules,
354 optional ImportESModuleOptionsDictionary aOptions = {});
357 * IF YOU ADD NEW METHODS HERE, MAKE SURE THEY ARE THREAD-SAFE.
362 * Additional ChromeUtils methods that are _not_ thread-safe, and hence not
363 * exposed in workers.
366 partial namespace ChromeUtils {
368 * A helper that converts OriginAttributesDictionary to a opaque suffix string.
370 * @param originAttrs The originAttributes from the caller.
373 originAttributesToSuffix(optional OriginAttributesDictionary originAttrs = {});
376 * Returns true if the members of |originAttrs| match the provided members
379 * @param originAttrs The originAttributes under consideration.
380 * @param pattern The pattern to use for matching.
383 originAttributesMatchPattern(optional OriginAttributesDictionary originAttrs = {},
384 optional OriginAttributesPatternDictionary pattern = {});
387 * Returns an OriginAttributesDictionary with values from the |origin| suffix
388 * and unspecified attributes added and assigned default values.
390 * @param origin The origin URI to create from.
391 * @returns An OriginAttributesDictionary with values from
392 * the origin suffix and unspecified attributes
393 * added and assigned default values.
396 OriginAttributesDictionary
397 createOriginAttributesFromOrigin(DOMString origin);
400 * Returns an OriginAttributesDictionary with values from the origin |suffix|
401 * and unspecified attributes added and assigned default values.
403 * @param suffix The origin suffix to create from.
404 * @returns An OriginAttributesDictionary with values from
405 * the origin suffix and unspecified attributes
406 * added and assigned default values.
409 OriginAttributesDictionary
410 CreateOriginAttributesFromOriginSuffix(DOMString suffix);
413 * Returns an OriginAttributesDictionary that is a copy of |originAttrs| with
414 * unspecified attributes added and assigned default values.
416 * @param originAttrs The origin attributes to copy.
417 * @returns An OriginAttributesDictionary copy of |originAttrs|
418 * with unspecified attributes added and assigned
421 OriginAttributesDictionary
422 fillNonDefaultOriginAttributes(optional OriginAttributesDictionary originAttrs = {});
425 * Returns true if the 2 OriginAttributes are equal.
428 isOriginAttributesEqual(optional OriginAttributesDictionary aA = {},
429 optional OriginAttributesDictionary aB = {});
432 * Returns the base domain portion of a given partitionKey.
433 * Returns the empty string for an empty partitionKey.
434 * Throws for invalid partition keys.
438 getBaseDomainFromPartitionKey(DOMString partitionKey);
441 * Returns the partitionKey for a given URL.
443 * The function will treat the URL as a first party and construct the
444 * partitionKey according to the scheme, site and port in the URL.
446 * Throws for invalid urls.
450 getPartitionKeyFromURL(DOMString url);
453 * Loads and compiles the script at the given URL and returns an object
454 * which may be used to execute it repeatedly, in different globals, without
458 Promise<PrecompiledScript>
459 compileScript(DOMString url, optional CompileScriptOptionsDictionary options = {});
462 * Returns an optimized QueryInterface method which, when called from
463 * JavaScript, acts as an ordinary QueryInterface function call, and when
464 * called from XPConnect, circumvents JSAPI entirely.
466 * The list of interfaces may include a mix of JS ID objects and interface
469 * nsISupports is implicitly supported, and must not be included in the
472 [Affects=Nothing, NewObject]
473 MozQueryInterface generateQI(sequence<any> interfaces);
476 * Waive Xray on a given value. Identity op for primitives.
479 any waiveXrays(any val);
482 * Strip off Xray waivers on a given value. Identity op for primitives.
485 any unwaiveXrays(any val);
488 * Gets the name of the JSClass of the object.
490 * if |unwrap| is true, all wrappers are unwrapped first. Unless you're
491 * specifically trying to detect whether the object is a proxy, this is
492 * probably what you want.
494 DOMString getClassName(object obj, optional boolean unwrap = true);
497 * Returns whether the object is a DOM object.
499 * if |unwrap| is true, all wrappers are unwrapped first. Unless you're
500 * specifically trying to detect whether the object is a proxy, this is
501 * probably what you want.
503 boolean isDOMObject(object obj, optional boolean unwrap = true);
506 * Returns whether |str| follows the Date Time String Format.
508 boolean isISOStyleDate(UTF8String str);
511 * Clones the properties of the given object into a new object in the given
512 * target compartment (or the caller compartment if no target is provided).
513 * Property values themeselves are not cloned.
515 * Ignores non-enumerable properties, properties on prototypes, and properties
516 * with getters or setters.
519 object shallowClone(object obj, optional object? target = null);
522 * Dispatches the given callback to the main thread when it would be
523 * otherwise idle. Similar to Window.requestIdleCallback, but not bound to a
524 * particular DOM windw.
527 undefined idleDispatch(IdleRequestCallback callback,
528 optional IdleRequestOptions options = {});
531 * Synchronously loads and evaluates the js file located at
532 * 'aResourceURI' with a new, fully privileged global object.
534 * If `aTargetObj` is specified all properties exported by the module are
535 * copied to that object. This is deprecated and should not be used in
538 * @param aResourceURI A resource:// URI string to load the module from.
539 * @param aTargetObj the object to install the exported properties on or null.
540 * @returns the module code's global object.
542 * The implementation maintains a hash of aResourceURI->global obj.
543 * Subsequent invocations of import with 'aResourceURI' pointing to
544 * the same file will not cause the module to be re-evaluated, but
545 * the symbols in EXPORTED_SYMBOLS will be exported into the
546 * specified target object and the global object returned as above.
548 * TODO: Remove this once m-c, c-c, and out-of-tree code migrations finish
552 object import(UTF8String aResourceURI, optional object aTargetObj);
555 * Defines a property on the given target which lazily imports a JavaScript
556 * module when accessed.
558 * The first time the property is accessed, the module at the given URL is
559 * imported, and the property is replaced with the module's exported symbol
562 * Some points to note when using this utility:
564 * - The cached module export is always stored on the `this` object that was
565 * used to access the getter. This means that if you define the lazy
566 * getter on a prototype, the module will be re-imported every time the
567 * property is accessed on a new instance.
569 * - The getter property may be overwritten by simple assignment, but as
570 * with imports, the new property value is always defined on the `this`
571 * object that the setter is called with.
573 * - If the module import fails, the getter will throw an error, and the
574 * property will not be replaced. Each subsequent attempt to access the
575 * getter will attempt to re-import the object, which will likely continue
576 * to result in errors.
578 * @param target The target object on which to define the property.
579 * @param id The name of the property to define, and of the symbol to
581 * @param resourceURI The resource URI of the module, as passed to
582 * ChromeUtils.import.
585 undefined defineModuleGetter(object target, DOMString id, DOMString resourceURI);
588 * Returns the scripted location of the first ancestor stack frame with a
589 * principal which is subsumed by the given principal. If no such frame
590 * exists on the call stack, returns null.
592 object? getCallerLocation(Principal principal);
595 * Creates a JS Error object with the given message and stack.
597 * If a stack object is provided, the error object is created in the global
598 * that it belongs to.
601 object createError(DOMString message, optional object? stack = null);
604 * Set the collection of specific detailed performance timing information.
605 * Selecting 0 for the mask will end existing collection. All metrics that
606 * are chosen will be cleared after updating the mask.
608 * @param aCollectionMask A bitmask where each bit corresponds to a metric
609 * to be collected as listed in PerfStats::Metric.
611 undefined setPerfStatsCollectionMask(unsigned long long aCollectionMask);
614 * Collect results of detailed performance timing information.
615 * The output is a JSON string containing performance timings.
618 Promise<DOMString> collectPerfStats();
621 * Returns a Promise containing a sequence of I/O activities
624 Promise<sequence<IOActivityDataDictionary>> requestIOActivity();
627 * Returns a Promise containing all processes info
630 Promise<ParentProcInfoDictionary> requestProcInfo();
633 * For testing purpose.
636 boolean vsyncEnabled();
639 boolean hasReportingHeaderForOrigin(DOMString aOrigin);
642 PopupBlockerState getPopupControlState();
645 * Milliseconds from the last iframe loading an external protocol.
648 double lastExternalProtocolIframeAllowed();
651 * For testing purpose we need to reset this value.
654 undefined resetLastExternalProtocolIframeAllowed();
657 * For webdriver consistency purposes, we need to be able to end a wheel
658 * transaction from the browser chrome.
661 undefined endWheelTransaction();
664 * Register a new toplevel window global actor. This method may only be
665 * called in the parent process. |name| must be globally unique.
667 * See JSWindowActor.webidl for WindowActorOptions fields documentation.
670 undefined registerWindowActor(UTF8String aName, optional WindowActorOptions aOptions = {});
673 undefined unregisterWindowActor(UTF8String aName);
676 * Register a new toplevel content global actor. This method may only be
677 * called in the parent process. |name| must be globally unique.
679 * See JSProcessActor.webidl for ProcessActorOptions fields documentation.
682 undefined registerProcessActor(UTF8String aName, optional ProcessActorOptions aOptions = {});
685 undefined unregisterProcessActor(UTF8String aName);
688 // aError should a nsresult.
689 boolean isClassifierBlockingErrorCode(unsigned long aError);
692 * If leak detection is enabled, print a note to the leak log that this
693 * process will intentionally crash. This should be called only on child
694 * processes for testing purpose.
697 undefined privateNoteIntentionalCrash();
700 * nsIDOMProcessChild for the current process.
703 readonly attribute nsIDOMProcessChild? domProcessChild;
706 * nsIDOMProcessParent for all processes.
708 * The first is for the parent process and all the next are for the content
712 sequence<nsIDOMProcessParent> getAllDOMProcesses();
715 * Returns a record of user interaction data. Currently only typing,
716 * but will include scrolling and potentially other metrics.
718 * Valid keys: "Typing"
721 record<DOMString, InteractionData> consumeInteractionData();
724 * Returns a record of user scrolling interactions collected from content processes.
726 * Valid keys: "Scrolling"
729 Promise<InteractionData> collectScrollingData();
732 sequence<FormAutofillConfidences> getFormAutofillConfidences(sequence<Element> elements);
735 * Returns whether the background of the element is dark.
737 boolean isDarkBackground(Element element);
740 * Starts the JSOracle process for ORB JavaScript validation, if it hasn't started already.
742 undefined ensureJSOracleStarted();
745 * The number of currently alive utility processes.
748 readonly attribute unsigned long aliveUtilityProcesses;
751 * Get a list of all possible Utility process Actor Names ; mostly useful to
752 * perform testing and ensure about:processes display is sound and misses no
756 sequence<UTF8String> getAllPossibleUtilityActorNames();
758 boolean shouldResistFingerprinting(JSRFPTarget target,
759 unsigned long long? overriddenFingerprintingSettings);
763 * This type is a WebIDL representation of mozilla::ProcType.
764 * These must match the similar ones in E10SUtils.sys.mjs, RemoteTypes.h,
765 * ProcInfo.h and ChromeUtils.cpp
767 enum WebIDLProcType {
783 "remoteSandboxBroker",
784 #ifdef MOZ_ENABLE_FORKSERVER
793 * These dictionaries hold information about Firefox running processes and
796 * See widget/ProcInfo.h for fields documentation.
798 dictionary ThreadInfoDictionary {
801 unsigned long long cpuCycleCount = 0;
802 unsigned long long cpuTime = 0;
805 dictionary WindowInfoDictionary {
806 // Window ID, as known to the parent process.
807 unsigned long long outerWindowId = 0;
809 // URI of the document loaded in the window.
810 URI? documentURI = null;
812 // Title of the document loaded in the window.
813 // Commonly empty for subframes.
814 DOMString documentTitle = "";
816 // `true` if this window is the root for the process.
817 boolean isProcessRoot = false;
819 // `true` if this is loaded in the same process as the parent, `false` otherwise.
820 boolean isInProcess = false;
824 * Add new entry to WebIDLUtilityActorName here and update accordingly
825 * UtilityActorNameToWebIDL in dom/base/ChromeUtils.cpp as well as
826 * UtilityActorName in toolkit/components/processtools/ProcInfo.h
828 enum WebIDLUtilityActorName {
830 "audioDecoder_Generic",
831 "audioDecoder_AppleMedia",
839 dictionary UtilityActorsDictionary {
840 WebIDLUtilityActorName actorName = "unknown";
844 * Information on a child process.
848 * If we lose a race with a process or thread attempting to close the
849 * target process, not all information is available.
851 * Missing information will generally have its default value.
853 dictionary ChildProcInfoDictionary {
856 // The cross-process descriptor for this process.
859 // The best end-user measure for "memory used" that we can obtain without
860 // triggering expensive computations. The value is in bytes.
861 // On Mac and Linux this matches the values shown by the system monitors.
862 // On Windows this will return the Commit Size.
863 unsigned long long memory = 0;
865 // Total CPU time spent by the process, in ns.
866 unsigned long long cpuTime = 0;
868 // Total CPU cycles used by this process.
869 // On Windows where the resolution of CPU timings is 16ms, this can
870 // be used to determine if a process is idle or slightly active.
871 unsigned long long cpuCycleCount = 0;
873 // Thread information for this process.
874 sequence<ThreadInfoDictionary> threads = [];
878 // Internal-to-Firefox process identifier.
879 unsigned long long childID = 0;
881 // The origin of the process, e.g. the subset of domain names
882 // that this subset serves.
883 UTF8String origin = "";
885 // Type of this child process.
886 WebIDLProcType type = "web";
888 // The windows implemented by this process.
889 sequence<WindowInfoDictionary> windows = [];
891 // The utility process list of actors if any
892 sequence<UtilityActorsDictionary> utilityActors = [];
896 * Information on the parent process.
898 dictionary ParentProcInfoDictionary {
901 // The cross-process descriptor for this process.
904 // The best end-user measure for "memory used" that we can obtain without
905 // triggering expensive computations. The value is in bytes.
906 // On Mac and Linux this matches the values shown by the system monitors.
907 // On Windows this will return the Commit Size.
908 unsigned long long memory = 0;
910 // Total CPU time spent by the process, in ns.
911 unsigned long long cpuTime = 0;
913 // Total CPU cycles used by this process.
914 // On Windows where the resolution of CPU timings is 16ms, this can
915 // be used to determine if a process is idle or slightly active.
916 unsigned long long cpuCycleCount = 0;
918 // Thread information for this process.
919 sequence<ThreadInfoDictionary> threads = [];
921 // Information on children processes.
922 sequence<ChildProcInfoDictionary> children = [];
925 // Type of this parent process.
926 // As of this writing, this is always `browser`.
927 WebIDLProcType type = "browser";
931 * Used by requestIOActivity() to return the number of bytes
932 * that were read (rx) and/or written (tx) for a given location.
934 * Locations can be sockets or files.
936 dictionary IOActivityDataDictionary {
937 ByteString location = "";
938 unsigned long long rx = 0;
939 unsigned long long tx = 0;
943 * Used by principals and the script security manager to represent origin
944 * attributes. The first dictionary is designed to contain the full set of
945 * OriginAttributes, the second is used for pattern-matching (i.e. does this
946 * OriginAttributesDictionary match the non-empty attributes in this pattern).
948 * IMPORTANT: If you add any members here, you need to do the following:
949 * (1) Add them to both dictionaries.
950 * (2) Update the methods on mozilla::OriginAttributes, including equality,
951 * serialization, deserialization, and inheritance.
952 * (3) Update the methods on mozilla::OriginAttributesPattern, including matching.
954 [GenerateInitFromJSON]
955 dictionary OriginAttributesDictionary {
956 unsigned long userContextId = 0;
957 unsigned long privateBrowsingId = 0;
958 DOMString firstPartyDomain = "";
959 DOMString geckoViewSessionContextId = "";
960 DOMString partitionKey = "";
963 [GenerateInitFromJSON, GenerateToJSON]
964 dictionary OriginAttributesPatternDictionary {
965 unsigned long userContextId;
966 unsigned long privateBrowsingId;
967 DOMString firstPartyDomain;
968 DOMString geckoViewSessionContextId;
969 // partitionKey takes precedence over partitionKeyPattern.
970 DOMString partitionKey;
971 PartitionKeyPatternDictionary partitionKeyPattern;
974 dictionary PartitionKeyPatternDictionary {
976 DOMString baseDomain;
978 boolean foreignByAncestorContext;
981 dictionary CompileScriptOptionsDictionary {
983 * The character set from which to decode the script.
985 DOMString charset = "utf-8";
988 * If true, certain parts of the script may be parsed lazily, the first time
989 * they are used, rather than eagerly parsed at load time.
991 boolean lazilyParse = false;
994 * If true, the script will be compiled so that its last expression will be
995 * returned as the value of its execution. This makes certain types of
996 * optimization impossible, and disables the JIT in many circumstances, so
997 * should not be used when not absolutely necessary.
999 boolean hasReturnValue = false;
1003 * Where the modules are loaded into with importESModule and
1004 * defineESModuleGetters.
1006 enum ImportESModuleTargetGlobal {
1008 * Load into the shared system global.
1009 * This is the default value.
1014 * Load into a distinct system global for DevTools, so that the DevTools can
1015 * load a distinct set of modules and do not interfere with its debuggee.
1020 * If the current global is DevTools' distinct system global, load into the
1021 * DevTools' distinct system global.
1022 * If the current thread is worker thread, load into the current global.
1023 * Otherwise load into the shared system global.
1025 * This is a temporary workaround until DevTools modules are ESMified.
1030 * Load into current global.
1032 * This can be used for any global. If this is used for shared global or
1033 * devtools global, this has the same effect as "shared" or "devtools".
1038 dictionary ImportESModuleOptionsDictionary {
1039 // This field is required for importESModule and defineESModuleGetters in
1040 // DevTools distinct global.
1041 ImportESModuleTargetGlobal global;
1045 * A JS object whose properties specify what portion of the heap graph to
1046 * write. The recognized properties are:
1048 * * globals: [ global, ... ]
1049 * Dump only nodes that either:
1050 * - belong in the compartment of one of the given globals;
1051 * - belong to no compartment, but do belong to a Zone that contains one of
1052 * the given globals;
1053 * - are referred to directly by one of the last two kinds of nodes; or
1054 * - is the fictional root node, described below.
1056 * * debugger: Debugger object
1057 * Like "globals", but use the Debugger's debuggees as the globals.
1060 * Dump the entire heap graph, starting with the JSRuntime's roots.
1062 * One, and only one, of these properties must exist on the boundaries object.
1064 * The root of the dumped graph is a fictional node whose ubi::Node type name is
1065 * "CoreDumpRoot". If we are dumping the entire ubi::Node graph, this root node
1066 * has an edge for each of the JSRuntime's roots. If we are dumping a selected
1067 * set of globals, the root has an edge to each global, and an edge for each
1068 * incoming JS reference to the selected Zones.
1070 dictionary HeapSnapshotBoundaries {
1071 sequence<object> globals;
1076 dictionary Base64URLEncodeOptions {
1077 /** Specifies whether the output should be padded with "=" characters. */
1078 required boolean pad;
1081 enum Base64URLDecodePadding {
1083 * Fails decoding if the input is unpadded. RFC 4648, section 3.2 requires
1084 * padding, unless the referring specification prohibits it.
1088 /** Tolerates padded and unpadded input. */
1092 * Fails decoding if the input is padded. This follows the strict base64url
1093 * variant used in JWS (RFC 7515, Appendix C) and HTTP Encrypted
1094 * Content-Encoding (draft-ietf-httpbis-encryption-encoding-01).
1099 dictionary Base64URLDecodeOptions {
1100 /** Specifies the padding mode for decoding the input. */
1101 required Base64URLDecodePadding padding;
1104 // Keep this in sync with PopupBlocker::PopupControlState!
1105 enum PopupBlockerState {
1113 // Subset of RFPTargets.inc with JS callers.
1114 // New values need to be handled in ChromeUtils::ShouldResistFingerprinting.
1121 dictionary LibcConstants {
1148 long PR_CAPBSET_READ;
1153 dictionary CDMInformation {
1154 required DOMString keySystemName;
1155 required DOMString capabilities;
1156 required boolean clearlead;
1157 required boolean isHDCP22Compatible;