2018-09-13 23:04:55 +03:00
|
|
|
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2015-05-28 17:37:42 +03:00
|
|
|
/* 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/.
|
|
|
|
*/
|
|
|
|
|
2018-04-23 06:32:11 +03:00
|
|
|
/**
|
|
|
|
* An optimized QueryInterface method, generated by generateQI.
|
|
|
|
*
|
|
|
|
* For JS callers, this behaves like a normal QueryInterface function. When
|
|
|
|
* called with a supported interface, it returns its `this` object. When
|
|
|
|
* called with an unsupported interface, it throws NS_ERROR_NO_INTERFACE.
|
|
|
|
*
|
|
|
|
* C++ callers use a fast path, and never call the JSAPI or WebIDL methods of
|
|
|
|
* this object.
|
|
|
|
*/
|
2018-10-21 03:02:53 +03:00
|
|
|
[ChromeOnly, Exposed=Window]
|
2018-04-23 06:32:11 +03:00
|
|
|
interface MozQueryInterface {
|
|
|
|
[Throws]
|
2018-07-18 07:30:38 +03:00
|
|
|
legacycaller any (any aIID);
|
2018-04-23 06:32:11 +03:00
|
|
|
};
|
|
|
|
|
2015-05-28 17:37:42 +03:00
|
|
|
/**
|
2017-11-08 08:25:33 +03:00
|
|
|
* A collection of static utility methods that are only exposed to system code.
|
|
|
|
* This is exposed in all the system globals where we can expose stuff by
|
|
|
|
* default, so should only include methods that are **thread-safe**.
|
2015-05-28 17:37:42 +03:00
|
|
|
*/
|
2018-10-21 03:02:53 +03:00
|
|
|
[ChromeOnly, Exposed=(Window,Worker)]
|
2017-11-08 08:25:33 +03:00
|
|
|
namespace ChromeUtils {
|
|
|
|
/**
|
|
|
|
* Serialize a snapshot of the heap graph, as seen by |JS::ubi::Node| and
|
|
|
|
* restricted by |boundaries|, and write it to the provided file path.
|
|
|
|
*
|
|
|
|
* @param boundaries The portion of the heap graph to write.
|
|
|
|
*
|
|
|
|
* @returns The path to the file the heap snapshot was written
|
|
|
|
* to. This is guaranteed to be within the temp
|
|
|
|
* directory and its file name will match the regexp
|
2018-10-12 01:13:47 +03:00
|
|
|
* `\d+(\-\d+)?\.fxsnapshot`.
|
2017-11-08 08:25:33 +03:00
|
|
|
*/
|
|
|
|
[Throws]
|
|
|
|
DOMString saveHeapSnapshot(optional HeapSnapshotBoundaries boundaries);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This is the same as saveHeapSnapshot, but with a different return value.
|
|
|
|
*
|
|
|
|
* @returns The snapshot ID of the file. This is the file name
|
|
|
|
* without the temp directory or the trailing
|
2018-10-12 01:13:47 +03:00
|
|
|
* `.fxsnapshot`.
|
2017-11-08 08:25:33 +03:00
|
|
|
*/
|
|
|
|
[Throws]
|
|
|
|
DOMString saveHeapSnapshotGetId(optional HeapSnapshotBoundaries boundaries);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deserialize a core dump into a HeapSnapshot.
|
|
|
|
*
|
|
|
|
* @param filePath The file path to read the heap snapshot from.
|
|
|
|
*/
|
|
|
|
[Throws, NewObject]
|
|
|
|
HeapSnapshot readHeapSnapshot(DOMString filePath);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return the keys in a weak map. This operation is
|
|
|
|
* non-deterministic because it is affected by the scheduling of the
|
|
|
|
* garbage collector and the cycle collector.
|
|
|
|
*
|
|
|
|
* @param aMap weak map or other JavaScript value
|
|
|
|
* @returns If aMap is a weak map object, return the keys of the weak
|
|
|
|
* map as an array. Otherwise, return undefined.
|
|
|
|
*/
|
|
|
|
[Throws, NewObject]
|
|
|
|
any nondeterministicGetWeakMapKeys(any map);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return the keys in a weak set. This operation is
|
|
|
|
* non-deterministic because it is affected by the scheduling of the
|
|
|
|
* garbage collector and the cycle collector.
|
|
|
|
*
|
|
|
|
* @param aSet weak set or other JavaScript value
|
|
|
|
* @returns If aSet is a weak set object, return the keys of the weak
|
|
|
|
* set as an array. Otherwise, return undefined.
|
|
|
|
*/
|
|
|
|
[Throws, NewObject]
|
|
|
|
any nondeterministicGetWeakSetKeys(any aSet);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Converts a buffer to a Base64 URL-encoded string per RFC 4648.
|
|
|
|
*
|
|
|
|
* @param source The buffer to encode.
|
|
|
|
* @param options Additional encoding options.
|
|
|
|
* @returns The encoded string.
|
|
|
|
*/
|
|
|
|
[Throws]
|
|
|
|
ByteString base64URLEncode(BufferSource source,
|
|
|
|
Base64URLEncodeOptions options);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Decodes a Base64 URL-encoded string per RFC 4648.
|
|
|
|
*
|
|
|
|
* @param string The string to decode.
|
|
|
|
* @param options Additional decoding options.
|
|
|
|
* @returns The decoded buffer.
|
|
|
|
*/
|
|
|
|
[Throws, NewObject]
|
|
|
|
ArrayBuffer base64URLDecode(ByteString string,
|
|
|
|
Base64URLDecodeOptions options);
|
|
|
|
|
2019-01-03 18:43:06 +03:00
|
|
|
/**
|
|
|
|
* Cause the current process to fatally crash unless the given condition is
|
|
|
|
* true. This is similar to MOZ_RELEASE_ASSERT in C++ code.
|
|
|
|
*
|
|
|
|
* WARNING: This message is included publicly in the crash report, and must
|
|
|
|
* not contain private information.
|
|
|
|
*
|
|
|
|
* Crash report will be augmented with the current JS stack information.
|
|
|
|
*/
|
|
|
|
void releaseAssert(boolean condition,
|
|
|
|
optional DOMString message = "<no message>");
|
|
|
|
|
2017-11-16 12:48:45 +03:00
|
|
|
#ifdef NIGHTLY_BUILD
|
|
|
|
|
|
|
|
/**
|
|
|
|
* If the chrome code has thrown a JavaScript Dev Error
|
|
|
|
* in the current JSRuntime. the first such error, or `undefined`
|
|
|
|
* otherwise.
|
|
|
|
*
|
|
|
|
* A JavaScript Dev Error is an exception thrown by JavaScript
|
|
|
|
* code that matches both conditions:
|
|
|
|
* - it was thrown by chrome code;
|
|
|
|
* - it is either a `ReferenceError`, a `TypeError` or a `SyntaxError`.
|
|
|
|
*
|
|
|
|
* Such errors are stored regardless of whether they have been
|
|
|
|
* caught.
|
|
|
|
*
|
|
|
|
* This mechanism is designed to help ensure that the code of
|
|
|
|
* Firefox is free from Dev Errors, even if they are accidentally
|
|
|
|
* caught by clients.
|
|
|
|
*
|
|
|
|
* The object returned is not an exception. It has fields:
|
|
|
|
* - DOMString stack
|
|
|
|
* - DOMString filename
|
|
|
|
* - DOMString lineNumber
|
|
|
|
* - DOMString message
|
|
|
|
*/
|
|
|
|
[Throws]
|
|
|
|
readonly attribute any recentJSDevError;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reset `recentJSDevError` to `undefined` for the current JSRuntime.
|
|
|
|
*/
|
|
|
|
void clearRecentJSDevError();
|
|
|
|
#endif // NIGHTLY_BUILD
|
|
|
|
|
2017-11-08 08:25:33 +03:00
|
|
|
/**
|
|
|
|
* IF YOU ADD NEW METHODS HERE, MAKE SURE THEY ARE THREAD-SAFE.
|
|
|
|
*/
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Additional ChromeUtils methods that are _not_ thread-safe, and hence not
|
|
|
|
* exposed in workers.
|
|
|
|
*/
|
2018-10-21 03:02:53 +03:00
|
|
|
[Exposed=Window]
|
2017-11-08 08:25:33 +03:00
|
|
|
partial namespace ChromeUtils {
|
2015-06-24 23:34:54 +03:00
|
|
|
/**
|
|
|
|
* A helper that converts OriginAttributesDictionary to a opaque suffix string.
|
|
|
|
*
|
|
|
|
* @param originAttrs The originAttributes from the caller.
|
|
|
|
*/
|
2017-11-08 08:25:33 +03:00
|
|
|
ByteString
|
2015-06-24 23:34:54 +03:00
|
|
|
originAttributesToSuffix(optional OriginAttributesDictionary originAttrs);
|
2015-07-09 21:36:35 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns true if the members of |originAttrs| match the provided members
|
|
|
|
* of |pattern|.
|
|
|
|
*
|
|
|
|
* @param originAttrs The originAttributes under consideration.
|
|
|
|
* @param pattern The pattern to use for matching.
|
|
|
|
*/
|
2017-11-08 08:25:33 +03:00
|
|
|
boolean
|
2015-07-09 21:36:35 +03:00
|
|
|
originAttributesMatchPattern(optional OriginAttributesDictionary originAttrs,
|
|
|
|
optional OriginAttributesPatternDictionary pattern);
|
2016-01-06 13:08:30 +03:00
|
|
|
|
2016-02-29 14:26:00 +03:00
|
|
|
/**
|
|
|
|
* Returns an OriginAttributesDictionary with values from the |origin| suffix
|
|
|
|
* and unspecified attributes added and assigned default values.
|
|
|
|
*
|
|
|
|
* @param origin The origin URI to create from.
|
|
|
|
* @returns An OriginAttributesDictionary with values from
|
|
|
|
* the origin suffix and unspecified attributes
|
|
|
|
* added and assigned default values.
|
2016-01-06 13:08:30 +03:00
|
|
|
*/
|
|
|
|
[Throws]
|
2017-11-08 08:25:33 +03:00
|
|
|
OriginAttributesDictionary
|
2016-02-29 14:26:00 +03:00
|
|
|
createOriginAttributesFromOrigin(DOMString origin);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns an OriginAttributesDictionary that is a copy of |originAttrs| with
|
|
|
|
* unspecified attributes added and assigned default values.
|
|
|
|
*
|
|
|
|
* @param originAttrs The origin attributes to copy.
|
|
|
|
* @returns An OriginAttributesDictionary copy of |originAttrs|
|
|
|
|
* with unspecified attributes added and assigned
|
|
|
|
* default values.
|
|
|
|
*/
|
2017-11-08 08:25:33 +03:00
|
|
|
OriginAttributesDictionary
|
2016-04-04 13:20:00 +03:00
|
|
|
fillNonDefaultOriginAttributes(optional OriginAttributesDictionary originAttrs);
|
2016-02-25 18:41:13 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns true if the 2 OriginAttributes are equal.
|
|
|
|
*/
|
2017-11-08 08:25:33 +03:00
|
|
|
boolean
|
2016-02-25 18:41:13 +03:00
|
|
|
isOriginAttributesEqual(optional OriginAttributesDictionary aA,
|
|
|
|
optional OriginAttributesDictionary aB);
|
2017-03-17 05:10:40 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Loads and compiles the script at the given URL and returns an object
|
|
|
|
* which may be used to execute it repeatedly, in different globals, without
|
|
|
|
* re-parsing.
|
|
|
|
*/
|
2017-11-08 08:25:33 +03:00
|
|
|
[NewObject]
|
|
|
|
Promise<PrecompiledScript>
|
2017-03-17 05:10:40 +03:00
|
|
|
compileScript(DOMString url, optional CompileScriptOptionsDictionary options);
|
2017-08-18 21:10:10 +03:00
|
|
|
|
2018-04-23 06:32:11 +03:00
|
|
|
/**
|
|
|
|
* Returns an optimized QueryInterface method which, when called from
|
|
|
|
* JavaScript, acts as an ordinary QueryInterface function call, and when
|
|
|
|
* called from XPConnect, circumvents JSAPI entirely.
|
|
|
|
*
|
2018-07-18 07:02:28 +03:00
|
|
|
* The list of interfaces may include a mix of JS ID objects and interface
|
|
|
|
* name strings.
|
2018-04-23 06:32:11 +03:00
|
|
|
*
|
|
|
|
* nsISupports is implicitly supported, and must not be included in the
|
|
|
|
* interface list.
|
|
|
|
*/
|
|
|
|
[Affects=Nothing, NewObject, Throws]
|
2018-07-18 07:02:28 +03:00
|
|
|
MozQueryInterface generateQI(sequence<any> interfaces);
|
2018-04-23 06:32:11 +03:00
|
|
|
|
2017-08-18 21:10:10 +03:00
|
|
|
/**
|
|
|
|
* Waive Xray on a given value. Identity op for primitives.
|
|
|
|
*/
|
|
|
|
[Throws]
|
2017-11-08 08:25:33 +03:00
|
|
|
any waiveXrays(any val);
|
2017-08-18 21:10:10 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Strip off Xray waivers on a given value. Identity op for primitives.
|
|
|
|
*/
|
|
|
|
[Throws]
|
2017-11-08 08:25:33 +03:00
|
|
|
any unwaiveXrays(any val);
|
2017-08-18 21:10:10 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the name of the JSClass of the object.
|
|
|
|
*
|
|
|
|
* if |unwrap| is true, all wrappers are unwrapped first. Unless you're
|
|
|
|
* specifically trying to detect whether the object is a proxy, this is
|
|
|
|
* probably what you want.
|
|
|
|
*/
|
2017-11-08 08:25:33 +03:00
|
|
|
DOMString getClassName(object obj, optional boolean unwrap = true);
|
2017-08-24 23:33:40 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Clones the properties of the given object into a new object in the given
|
|
|
|
* target compartment (or the caller compartment if no target is provided).
|
|
|
|
* Property values themeselves are not cloned.
|
|
|
|
*
|
|
|
|
* Ignores non-enumerable properties, properties on prototypes, and properties
|
|
|
|
* with getters or setters.
|
|
|
|
*/
|
|
|
|
[Throws]
|
2017-11-08 08:25:33 +03:00
|
|
|
object shallowClone(object obj, optional object? target = null);
|
2017-09-24 08:12:32 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Dispatches the given callback to the main thread when it would be
|
|
|
|
* otherwise idle. Similar to Window.requestIdleCallback, but not bound to a
|
|
|
|
* particular DOM windw.
|
|
|
|
*/
|
|
|
|
[Throws]
|
2017-11-08 08:25:33 +03:00
|
|
|
void idleDispatch(IdleRequestCallback callback,
|
|
|
|
optional IdleRequestOptions options);
|
2017-12-16 08:30:25 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Synchronously loads and evaluates the js file located at
|
|
|
|
* 'aResourceURI' with a new, fully privileged global object.
|
|
|
|
*
|
|
|
|
* If 'aTargetObj' is specified and null, this method just returns
|
|
|
|
* the module's global object. Otherwise (if 'aTargetObj' is not
|
|
|
|
* specified, or 'aTargetObj' is != null) looks for a property
|
|
|
|
* 'EXPORTED_SYMBOLS' on the new global object. 'EXPORTED_SYMBOLS'
|
|
|
|
* is expected to be an array of strings identifying properties on
|
|
|
|
* the global object. These properties will be installed as
|
|
|
|
* properties on 'targetObj', or, if 'aTargetObj' is not specified,
|
|
|
|
* on the caller's global object. If 'EXPORTED_SYMBOLS' is not
|
|
|
|
* found, an error is thrown.
|
|
|
|
*
|
|
|
|
* @param aResourceURI A resource:// URI string to load the module from.
|
|
|
|
* @param aTargetObj the object to install the exported properties on or null.
|
|
|
|
* @returns the module code's global object.
|
|
|
|
*
|
|
|
|
* The implementation maintains a hash of aResourceURI->global obj.
|
|
|
|
* Subsequent invocations of import with 'aResourceURI' pointing to
|
|
|
|
* the same file will not cause the module to be re-evaluated, but
|
|
|
|
* the symbols in EXPORTED_SYMBOLS will be exported into the
|
|
|
|
* specified target object and the global object returned as above.
|
|
|
|
*/
|
|
|
|
[Throws]
|
|
|
|
object import(DOMString aResourceURI, optional object? aTargetObj);
|
2018-01-18 06:20:16 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Defines a property on the given target which lazily imports a JavaScript
|
|
|
|
* module when accessed.
|
|
|
|
*
|
|
|
|
* The first time the property is accessed, the module at the given URL is
|
|
|
|
* imported, and the property is replaced with the module's exported symbol
|
|
|
|
* of the same name.
|
|
|
|
*
|
|
|
|
* Some points to note when using this utility:
|
|
|
|
*
|
|
|
|
* - The cached module export is always stored on the `this` object that was
|
|
|
|
* used to access the getter. This means that if you define the lazy
|
|
|
|
* getter on a prototype, the module will be re-imported every time the
|
|
|
|
* property is accessed on a new instance.
|
|
|
|
*
|
|
|
|
* - The getter property may be overwritten by simple assignment, but as
|
|
|
|
* with imports, the new property value is always defined on the `this`
|
|
|
|
* object that the setter is called with.
|
|
|
|
*
|
|
|
|
* - If the module import fails, the getter will throw an error, and the
|
|
|
|
* property will not be replaced. Each subsequent attempt to access the
|
|
|
|
* getter will attempt to re-import the object, which will likely continue
|
|
|
|
* to result in errors.
|
|
|
|
*
|
|
|
|
* @param target The target object on which to define the property.
|
|
|
|
* @param id The name of the property to define, and of the symbol to
|
|
|
|
* import.
|
|
|
|
* @param resourceURI The resource URI of the module, as passed to
|
|
|
|
* ChromeUtils.import.
|
|
|
|
*/
|
|
|
|
[Throws]
|
|
|
|
void defineModuleGetter(object target, DOMString id, DOMString resourceURI);
|
Bug 1441333: Part 1 - Add helper to retrieve closest stack frame with a given principal. r=bz
Most WebExtension APIs are async, and have fairly complicated error reporting
semantics. As a result, when we report an error, the current JS stack has very
little to do with the JS caller that triggered the error, which makes it
difficult to diagnose.
In order to improve the situation, we need to store the location of the caller
at the start of an async operation, so we can tie the error to some marginally
useful location. We don't have a reasonable way to do that now other than
proactively creating an error object when the API is called, or creating a
promise with a full async stack, both of which are too expensive.
This helper instead returns a single SavedStack frame with a given principal,
which should be considerably cheaper, and likely good enough to give a
starting point for debugging cryptic errors.
MozReview-Commit-ID: BTxhpZK9Fdz
--HG--
extra : rebase_source : 7f2c66b1dc18d4ce4c47bef2e3b9d5d3ade929aa
2017-11-12 04:39:16 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the scripted location of the first ancestor stack frame with a
|
|
|
|
* principal which is subsumed by the given principal. If no such frame
|
|
|
|
* exists on the call stack, returns null.
|
|
|
|
*/
|
|
|
|
object? getCallerLocation(Principal principal);
|
2018-03-02 01:00:00 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates a JS Error object with the given message and stack.
|
|
|
|
*
|
|
|
|
* If a stack object is provided, the error object is created in the global
|
|
|
|
* that it belongs to.
|
|
|
|
*/
|
|
|
|
[Throws]
|
|
|
|
object createError(DOMString message, optional object? stack = null);
|
2018-04-23 11:49:45 +03:00
|
|
|
|
|
|
|
/**
|
2018-07-05 17:32:03 +03:00
|
|
|
* Request performance metrics to the current process & all content processes.
|
2018-04-23 11:49:45 +03:00
|
|
|
*/
|
2018-09-10 21:36:18 +03:00
|
|
|
[Throws, Func="DOMPrefs::dom_performance_enable_scheduler_timing"]
|
2018-07-05 17:32:03 +03:00
|
|
|
Promise<sequence<PerformanceInfoDictionary>> requestPerformanceMetrics();
|
2018-06-26 11:43:16 +03:00
|
|
|
|
|
|
|
/**
|
2018-07-06 14:43:08 +03:00
|
|
|
* Returns a Promise containing a sequence of I/O activities
|
2018-06-26 11:43:16 +03:00
|
|
|
*/
|
2018-07-06 14:43:08 +03:00
|
|
|
[Throws]
|
|
|
|
Promise<sequence<IOActivityDataDictionary>> requestIOActivity();
|
2018-08-29 05:00:00 +03:00
|
|
|
|
2018-11-12 20:57:48 +03:00
|
|
|
/**
|
|
|
|
* Returns the BrowsingContext referred by the given id.
|
|
|
|
*/
|
|
|
|
[ChromeOnly]
|
|
|
|
BrowsingContext? getBrowsingContext(unsigned long long id);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns all the root BrowsingContexts.
|
|
|
|
*/
|
2018-08-29 05:00:00 +03:00
|
|
|
[ChromeOnly]
|
|
|
|
sequence<BrowsingContext> getRootBrowsingContexts();
|
2018-12-01 23:26:10 +03:00
|
|
|
|
|
|
|
[ChromeOnly, Throws]
|
|
|
|
boolean hasReportingHeaderForOrigin(DOMString aOrigin);
|
2019-01-04 18:16:59 +03:00
|
|
|
|
|
|
|
[ChromeOnly]
|
|
|
|
PopupBlockerState getPopupControlState();
|
|
|
|
|
|
|
|
[ChromeOnly]
|
|
|
|
boolean isPopupTokenUnused();
|
2018-07-06 14:43:08 +03:00
|
|
|
};
|
|
|
|
|
2018-07-05 17:32:03 +03:00
|
|
|
/**
|
|
|
|
* Dictionaries duplicating IPDL types in dom/ipc/DOMTypes.ipdlh
|
|
|
|
* Used by requestPerformanceMetrics
|
|
|
|
*/
|
2018-11-20 01:51:12 +03:00
|
|
|
|
|
|
|
dictionary MediaMemoryInfoDictionary {
|
|
|
|
unsigned long long audioSize = 0;
|
|
|
|
unsigned long long videoSize = 0;
|
|
|
|
unsigned long long resourcesSize = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
dictionary MemoryInfoDictionary {
|
|
|
|
unsigned long long domDom = 0;
|
|
|
|
unsigned long long domStyle = 0;
|
|
|
|
unsigned long long domOther = 0;
|
|
|
|
unsigned long long GCHeapUsage = 0;
|
|
|
|
required MediaMemoryInfoDictionary media;
|
|
|
|
};
|
|
|
|
|
2018-07-05 17:32:03 +03:00
|
|
|
dictionary CategoryDispatchDictionary
|
|
|
|
{
|
|
|
|
unsigned short category = 0;
|
|
|
|
unsigned short count = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
dictionary PerformanceInfoDictionary {
|
2018-07-10 10:58:48 +03:00
|
|
|
ByteString host = "";
|
2018-07-05 17:32:03 +03:00
|
|
|
unsigned long pid = 0;
|
2018-07-10 10:58:48 +03:00
|
|
|
unsigned long long windowId = 0;
|
2018-07-05 17:32:03 +03:00
|
|
|
unsigned long long duration = 0;
|
2018-07-27 12:44:22 +03:00
|
|
|
unsigned long long counterId = 0;
|
2018-07-10 10:58:48 +03:00
|
|
|
boolean isWorker = false;
|
|
|
|
boolean isTopLevel = false;
|
2018-11-20 01:51:12 +03:00
|
|
|
required MemoryInfoDictionary memoryInfo;
|
2018-07-05 17:32:03 +03:00
|
|
|
sequence<CategoryDispatchDictionary> items = [];
|
|
|
|
};
|
2018-07-06 14:43:08 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Used by requestIOActivity() to return the number of bytes
|
|
|
|
* that were read (rx) and/or written (tx) for a given location.
|
|
|
|
*
|
|
|
|
* Locations can be sockets or files.
|
|
|
|
*/
|
|
|
|
dictionary IOActivityDataDictionary {
|
|
|
|
ByteString location = "";
|
|
|
|
unsigned long long rx = 0;
|
|
|
|
unsigned long long tx = 0;
|
2015-05-28 17:37:42 +03:00
|
|
|
};
|
|
|
|
|
2015-06-03 09:35:09 +03:00
|
|
|
/**
|
|
|
|
* Used by principals and the script security manager to represent origin
|
2015-07-09 21:36:35 +03:00
|
|
|
* attributes. The first dictionary is designed to contain the full set of
|
|
|
|
* OriginAttributes, the second is used for pattern-matching (i.e. does this
|
|
|
|
* OriginAttributesDictionary match the non-empty attributes in this pattern).
|
2015-06-03 09:35:09 +03:00
|
|
|
*
|
2015-07-09 21:36:35 +03:00
|
|
|
* IMPORTANT: If you add any members here, you need to do the following:
|
|
|
|
* (1) Add them to both dictionaries.
|
|
|
|
* (2) Update the methods on mozilla::OriginAttributes, including equality,
|
2015-11-03 04:50:54 +03:00
|
|
|
* serialization, deserialization, and inheritance.
|
2015-07-09 21:36:35 +03:00
|
|
|
* (3) Update the methods on mozilla::OriginAttributesPattern, including matching.
|
2015-06-03 09:35:09 +03:00
|
|
|
*/
|
|
|
|
dictionary OriginAttributesDictionary {
|
|
|
|
unsigned long appId = 0;
|
2015-07-29 00:32:00 +03:00
|
|
|
unsigned long userContextId = 0;
|
2016-02-05 04:42:44 +03:00
|
|
|
boolean inIsolatedMozBrowser = false;
|
2016-06-03 00:02:29 +03:00
|
|
|
unsigned long privateBrowsingId = 0;
|
2016-08-09 11:34:53 +03:00
|
|
|
DOMString firstPartyDomain = "";
|
2015-06-03 09:35:09 +03:00
|
|
|
};
|
2015-07-09 21:36:35 +03:00
|
|
|
dictionary OriginAttributesPatternDictionary {
|
|
|
|
unsigned long appId;
|
2015-07-29 00:32:00 +03:00
|
|
|
unsigned long userContextId;
|
2016-02-05 04:42:44 +03:00
|
|
|
boolean inIsolatedMozBrowser;
|
2016-06-03 00:02:29 +03:00
|
|
|
unsigned long privateBrowsingId;
|
2016-08-09 11:34:53 +03:00
|
|
|
DOMString firstPartyDomain;
|
2015-07-09 21:36:35 +03:00
|
|
|
};
|
2017-03-17 05:10:40 +03:00
|
|
|
|
|
|
|
dictionary CompileScriptOptionsDictionary {
|
|
|
|
/**
|
|
|
|
* The character set from which to decode the script.
|
|
|
|
*/
|
|
|
|
DOMString charset = "utf-8";
|
|
|
|
|
|
|
|
/**
|
|
|
|
* If true, certain parts of the script may be parsed lazily, the first time
|
|
|
|
* they are used, rather than eagerly parsed at load time.
|
|
|
|
*/
|
|
|
|
boolean lazilyParse = false;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* If true, the script will be compiled so that its last expression will be
|
|
|
|
* returned as the value of its execution. This makes certain types of
|
|
|
|
* optimization impossible, and disables the JIT in many circumstances, so
|
|
|
|
* should not be used when not absolutely necessary.
|
|
|
|
*/
|
|
|
|
boolean hasReturnValue = false;
|
|
|
|
};
|
2017-11-08 08:25:33 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* A JS object whose properties specify what portion of the heap graph to
|
|
|
|
* write. The recognized properties are:
|
|
|
|
*
|
|
|
|
* * globals: [ global, ... ]
|
|
|
|
* Dump only nodes that either:
|
|
|
|
* - belong in the compartment of one of the given globals;
|
|
|
|
* - belong to no compartment, but do belong to a Zone that contains one of
|
|
|
|
* the given globals;
|
|
|
|
* - are referred to directly by one of the last two kinds of nodes; or
|
|
|
|
* - is the fictional root node, described below.
|
|
|
|
*
|
|
|
|
* * debugger: Debugger object
|
|
|
|
* Like "globals", but use the Debugger's debuggees as the globals.
|
|
|
|
*
|
|
|
|
* * runtime: true
|
|
|
|
* Dump the entire heap graph, starting with the JSRuntime's roots.
|
|
|
|
*
|
|
|
|
* One, and only one, of these properties must exist on the boundaries object.
|
|
|
|
*
|
|
|
|
* The root of the dumped graph is a fictional node whose ubi::Node type name is
|
|
|
|
* "CoreDumpRoot". If we are dumping the entire ubi::Node graph, this root node
|
|
|
|
* has an edge for each of the JSRuntime's roots. If we are dumping a selected
|
|
|
|
* set of globals, the root has an edge to each global, and an edge for each
|
|
|
|
* incoming JS reference to the selected Zones.
|
|
|
|
*/
|
|
|
|
dictionary HeapSnapshotBoundaries {
|
|
|
|
sequence<object> globals;
|
|
|
|
object debugger;
|
|
|
|
boolean runtime;
|
|
|
|
};
|
|
|
|
|
|
|
|
dictionary Base64URLEncodeOptions {
|
|
|
|
/** Specifies whether the output should be padded with "=" characters. */
|
|
|
|
required boolean pad;
|
|
|
|
};
|
|
|
|
|
|
|
|
enum Base64URLDecodePadding {
|
|
|
|
/**
|
|
|
|
* Fails decoding if the input is unpadded. RFC 4648, section 3.2 requires
|
|
|
|
* padding, unless the referring specification prohibits it.
|
|
|
|
*/
|
|
|
|
"require",
|
|
|
|
|
|
|
|
/** Tolerates padded and unpadded input. */
|
|
|
|
"ignore",
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Fails decoding if the input is padded. This follows the strict base64url
|
|
|
|
* variant used in JWS (RFC 7515, Appendix C) and HTTP Encrypted
|
|
|
|
* Content-Encoding (draft-ietf-httpbis-encryption-encoding-01).
|
|
|
|
*/
|
|
|
|
"reject"
|
|
|
|
};
|
|
|
|
|
|
|
|
dictionary Base64URLDecodeOptions {
|
|
|
|
/** Specifies the padding mode for decoding the input. */
|
|
|
|
required Base64URLDecodePadding padding;
|
|
|
|
};
|
2019-01-04 18:16:59 +03:00
|
|
|
|
|
|
|
// Keep this in sync with PopupBlocker::PopupControlState!
|
|
|
|
enum PopupBlockerState {
|
|
|
|
"openAllowed",
|
|
|
|
"openControlled",
|
|
|
|
"openBlocked",
|
|
|
|
"openAbused",
|
|
|
|
"openOverridden",
|
|
|
|
};
|