Bug 1766130 - Mark throwing Promise-returning methods that create a new Promise as NewObject. r=smaug

Differential Revision: https://phabricator.services.mozilla.com/D144516
This commit is contained in:
Peter Van der Beken 2022-05-02 07:44:24 +00:00
Родитель e77783380e
Коммит e63aa7ad0f
48 изменённых файлов: 120 добавлений и 121 удалений

Просмотреть файл

@ -299,7 +299,7 @@ interface CanonicalBrowsingContext : BrowsingContext {
* set to prevent prompting.
* @return A Promise that resolves once printing is finished.
*/
[Throws]
[NewObject]
Promise<void> print(nsIPrintSettings aPrintSettings);
/**

Просмотреть файл

@ -481,7 +481,7 @@ partial namespace ChromeUtils {
/**
* Request performance metrics to the current process & all content processes.
*/
[Throws]
[NewObject]
Promise<sequence<PerformanceInfoDictionary>> requestPerformanceMetrics();
/**
@ -498,19 +498,19 @@ partial namespace ChromeUtils {
* Collect results of detailed performance timing information.
* The output is a JSON string containing performance timings.
*/
[Throws]
[NewObject]
Promise<DOMString> collectPerfStats();
/**
* Returns a Promise containing a sequence of I/O activities
*/
[Throws]
[NewObject]
Promise<sequence<IOActivityDataDictionary>> requestIOActivity();
/**
* Returns a Promise containing all processes info
*/
[Throws]
[NewObject]
Promise<ParentProcInfoDictionary> requestProcInfo();
/**
@ -602,7 +602,7 @@ partial namespace ChromeUtils {
*
* Valid keys: "Scrolling"
*/
[Throws]
[NewObject]
Promise<InteractionData> collectScrollingData();
[Throws]

Просмотреть файл

@ -73,7 +73,7 @@ interface FrameLoader {
* Returns a promise that resolves when all session store data has been
* flushed.
*/
[Throws]
[NewObject]
Promise<void> requestTabStateFlush();
/**
@ -102,14 +102,13 @@ interface FrameLoader {
* preview document with a new print settings object.
* @return A Promise that resolves with a PrintPreviewSuccessInfo on success.
*/
[ChromeOnly, Throws]
[NewObject]
Promise<unsigned long> printPreview(nsIPrintSettings aPrintSettings,
BrowsingContext? aSourceBrowsingContext);
/**
* Inform the print preview document that we're done with it.
*/
[ChromeOnly]
void exitPrintPreview();
/**

Просмотреть файл

@ -10,7 +10,7 @@ interface mixin JSActor {
void sendAsyncMessage(DOMString messageName,
optional any obj);
[Throws]
[NewObject]
Promise<any> sendQuery(DOMString messageName,
optional any obj);

Просмотреть файл

@ -124,7 +124,7 @@ interface L10nFileSource {
[Throws]
L10nFileSourceHasFileStatus hasFile(UTF8String locale, UTF8String path);
[Throws]
[NewObject]
Promise<FluentResource?> fetchFile(UTF8String locale, UTF8String path);
[Throws]
FluentResource? fetchFileSync(UTF8String locale, UTF8String path);

Просмотреть файл

@ -133,24 +133,24 @@ partial namespace PathUtils {
/**
* The profile directory.
*/
[Throws, BinaryName="GetProfileDirAsync"]
[NewObject, BinaryName="GetProfileDirAsync"]
Promise<DOMString> getProfileDir();
/**
* The local-specific profile directory.
*/
[Throws, BinaryName="GetLocalProfileDirAsync"]
[NewObject, BinaryName="GetLocalProfileDirAsync"]
Promise<DOMString> getLocalProfileDir();
/**
* The temporary directory for the process.
*/
[Throws, BinaryName="GetTempDirAsync"]
[NewObject, BinaryName="GetTempDirAsync"]
Promise<DOMString> getTempDir();
/**
* The OS temporary directory.
*/
[Throws, BinaryName="GetOSTempDirAsync"]
[NewObject, BinaryName="GetOSTempDirAsync"]
Promise<DOMString> getOSTempDir();
};

Просмотреть файл

@ -119,7 +119,7 @@ namespace SessionStoreUtils {
Promise<void> initializeRestore(CanonicalBrowsingContext browsingContext,
nsISessionStoreRestoreData? data);
[Throws]
[NewObject]
Promise<void> restoreDocShellState(
CanonicalBrowsingContext browsingContext,
UTF8String? url,

Просмотреть файл

@ -87,7 +87,7 @@ interface WindowGlobalParent : WindowContext {
// navigation before proceeding. If the user needs to be prompted, however,
// the promise will not resolve until the user has responded, regardless of
// the timeout.
[Throws]
[NewObject]
Promise<boolean> permitUnload(optional PermitUnloadAction action = "prompt",
optional unsigned long timeout = 0);
@ -140,7 +140,7 @@ interface WindowGlobalParent : WindowContext {
* cannot access the rendering of out of process iframes. This API works
* with remote and local frames.
*/
[Throws]
[NewObject]
Promise<ImageBitmap> drawSnapshot(DOMRect? rect,
double scale,
UTF8String backgroundColor,
@ -155,7 +155,7 @@ interface WindowGlobalParent : WindowContext {
* This returns a Promise which resolves to an nsITransportSecurity
* object with certificate data or undefined if no security info is available.
*/
[Throws]
[NewObject]
Promise<nsITransportSecurityInfo> getSecurityInfo();
// True if any of the windows in the subtree rooted at this window

Просмотреть файл

@ -29,9 +29,9 @@ interface AudioContext : BaseAudioContext {
readonly attribute double outputLatency;
AudioTimestamp getOutputTimestamp();
[Throws]
[NewObject]
Promise<void> suspend();
[Throws]
[NewObject]
Promise<void> close();
[NewObject, Throws]

Просмотреть файл

@ -29,7 +29,7 @@ interface BaseAudioContext : EventTarget {
[Throws, SameObject, SecureContext, Pref="dom.audioworklet.enabled"]
readonly attribute AudioWorklet audioWorklet;
[Throws]
[NewObject]
Promise<void> resume();
attribute EventHandler onstatechange;
@ -39,7 +39,7 @@ interface BaseAudioContext : EventTarget {
unsigned long length,
float sampleRate);
[Throws]
[NewObject]
Promise<AudioBuffer> decodeAudioData(ArrayBuffer audioData,
optional DecodeSuccessCallback successCallback,
optional DecodeErrorCallback errorCallback);

Просмотреть файл

@ -34,7 +34,7 @@ interface CSSStyleSheet : StyleSheet {
unsigned long insertRule(UTF8String rule, optional unsigned long index = 0);
[Throws, NeedsSubjectPrincipal]
void deleteRule(unsigned long index);
[Throws, Pref="layout.css.constructable-stylesheets.enabled"]
[NewObject, Pref="layout.css.constructable-stylesheets.enabled"]
Promise<CSSStyleSheet> replace(UTF8String text);
[Throws, Pref="layout.css.constructable-stylesheets.enabled"]
void replaceSync(UTF8String text);

Просмотреть файл

@ -14,15 +14,15 @@ typedef sequence<ClipboardItem> ClipboardItems;
[SecureContext, Exposed=Window]
interface Clipboard : EventTarget {
[Pref="dom.events.asyncClipboard.read", Throws, NeedsSubjectPrincipal]
[Pref="dom.events.asyncClipboard.read", NewObject, NeedsSubjectPrincipal]
Promise<ClipboardItems> read();
[Func="Clipboard::ReadTextEnabled", Throws, NeedsSubjectPrincipal]
[Func="Clipboard::ReadTextEnabled", NewObject, NeedsSubjectPrincipal]
Promise<DOMString> readText();
[Pref="dom.events.asyncClipboard.clipboardItem", Throws, NeedsSubjectPrincipal]
[Pref="dom.events.asyncClipboard.clipboardItem", NewObject, NeedsSubjectPrincipal]
Promise<void> write(ClipboardItems data);
[Throws, NeedsSubjectPrincipal]
[NewObject, NeedsSubjectPrincipal]
Promise<void> writeText(DOMString data);
};
@ -50,7 +50,7 @@ interface ClipboardItem {
[Frozen, Cached, Pure]
readonly attribute sequence<DOMString> types;
[Throws]
[NewObject]
Promise<Blob> getType(DOMString type);
};

Просмотреть файл

@ -15,13 +15,13 @@ interface Credential {
[Exposed=Window, SecureContext, Pref="security.webauth.webauthn"]
interface CredentialsContainer {
[Throws]
[NewObject]
Promise<Credential?> get(optional CredentialRequestOptions options = {});
[Throws]
[NewObject]
Promise<Credential?> create(optional CredentialCreationOptions options = {});
[Throws]
[NewObject]
Promise<Credential> store(Credential credential);
[Throws]
[NewObject]
Promise<void> preventSilentAccess();
};

Просмотреть файл

@ -47,9 +47,9 @@ partial interface Directory {
/*
* Getter for the immediate children of this directory.
*/
[Throws]
[NewObject]
Promise<sequence<(File or Directory)>> getFilesAndDirectories();
[Throws]
[NewObject]
Promise<sequence<File>> getFiles(optional boolean recursiveFlag = false);
};

Просмотреть файл

@ -297,9 +297,9 @@ partial interface Document {
[BinaryName="fullscreenEnabled", NeedsCallerType]
readonly attribute boolean mozFullScreenEnabled;
[Throws]
[NewObject]
Promise<void> exitFullscreen();
[Throws, BinaryName="exitFullscreen"]
[NewObject, BinaryName="exitFullscreen"]
Promise<void> mozCancelFullScreen();
// Events handlers
@ -448,7 +448,7 @@ partial interface Document {
[ChromeOnly] readonly attribute nsILoadGroup? documentLoadGroup;
// Blocks the initial document parser until the given promise is settled.
[ChromeOnly, Throws]
[ChromeOnly, NewObject]
Promise<any> blockParsing(Promise<any> promise,
optional BlockParsingOptions options = {});
@ -540,9 +540,9 @@ partial interface Document {
// https://github.com/whatwg/html/issues/3338
partial interface Document {
[Pref="dom.storage_access.enabled", Throws]
[Pref="dom.storage_access.enabled", NewObject]
Promise<boolean> hasStorageAccess();
[Pref="dom.storage_access.enabled", Throws]
[Pref="dom.storage_access.enabled", NewObject]
Promise<void> requestStorageAccess();
};
@ -550,7 +550,7 @@ partial interface Document {
// webcompat extension the ability to request the storage access for a given
// third party.
partial interface Document {
[Func="Document::CallerCanAccessPrivilegeSSA", Throws]
[Func="Document::CallerCanAccessPrivilegeSSA", NewObject]
Promise<void> requestStorageAccessForOrigin(DOMString thirdPartyOrigin, optional boolean requireUserInteraction = true);
};

Просмотреть файл

@ -305,9 +305,9 @@ Element includes AriaAttributes;
// https://fullscreen.spec.whatwg.org/#api
partial interface Element {
[Throws, NeedsCallerType]
[NewObject, NeedsCallerType]
Promise<void> requestFullscreen();
[Throws, BinaryName="requestFullscreen", NeedsCallerType, Deprecated="MozRequestFullScreenDeprecatedPrefix"]
[NewObject, BinaryName="requestFullscreen", NeedsCallerType, Deprecated="MozRequestFullScreenDeprecatedPrefix"]
Promise<void> mozRequestFullScreen();
// Events handlers

Просмотреть файл

@ -15,15 +15,15 @@ typedef XMLHttpRequestBodyInit BodyInit;
interface mixin Body {
[Throws]
readonly attribute boolean bodyUsed;
[Throws]
[NewObject]
Promise<ArrayBuffer> arrayBuffer();
[Throws]
[NewObject]
Promise<Blob> blob();
[Throws]
[NewObject]
Promise<FormData> formData();
[Throws]
[NewObject]
Promise<JSON> json();
[Throws]
[NewObject]
Promise<USVString> text();
};

Просмотреть файл

@ -50,11 +50,11 @@ partial interface File {
// `dom.file.createInChild' set to true.
[Exposed=(Window)]
partial interface File {
[ChromeOnly, Throws, NeedsCallerType]
[ChromeOnly, NewObject, NeedsCallerType]
static Promise<File> createFromNsIFile(nsIFile file,
optional ChromeFilePropertyBag options = {});
[ChromeOnly, Throws, NeedsCallerType]
[ChromeOnly, NewObject, NeedsCallerType]
static Promise<File> createFromFileName(USVString fileName,
optional ChromeFilePropertyBag options = {});
};

Просмотреть файл

@ -12,7 +12,7 @@ interface GamepadServiceTest
readonly attribute GamepadHand leftHand;
readonly attribute GamepadHand rightHand;
[Throws]
[NewObject]
Promise<unsigned long> addGamepad(DOMString id,
GamepadMappingType mapping,
GamepadHand hand,
@ -22,27 +22,27 @@ interface GamepadServiceTest
unsigned long numLightIndicator,
unsigned long numTouchEvents);
[Throws]
[NewObject]
Promise<unsigned long> removeGamepad(unsigned long index);
[Throws]
[NewObject]
Promise<unsigned long> newButtonEvent(unsigned long index,
unsigned long button,
boolean pressed,
boolean touched);
[Throws]
[NewObject]
Promise<unsigned long> newButtonValueEvent(unsigned long index,
unsigned long button,
boolean pressed,
boolean touched,
double value);
[Throws]
[NewObject]
Promise<unsigned long> newAxisMoveEvent(unsigned long index,
unsigned long axis,
double value);
[Throws]
[NewObject]
Promise<unsigned long> newPoseMove(unsigned long index,
Float32Array? orient,
Float32Array? pos,
@ -51,7 +51,7 @@ interface GamepadServiceTest
Float32Array? linVelocity,
Float32Array? linAcceleration);
[Throws]
[NewObject]
Promise<unsigned long> newTouch(unsigned long index, unsigned long aTouchArrayIndex,
unsigned long touchId, octet surfaceId,
Float32Array position, Float32Array? surfaceDimension);

Просмотреть файл

@ -174,7 +174,7 @@ partial interface HTMLInputElement {
void mozSetDndFilesAndDirectories(sequence<(File or Directory)> list);
// This method is meant to use for testing only.
[ChromeOnly, Throws]
[ChromeOnly, NewObject]
Promise<sequence<(File or Directory)>> getFilesAndDirectories();
boolean mozIsTextField(boolean aExcludePassword);

Просмотреть файл

@ -68,7 +68,7 @@ interface HTMLMediaElement : HTMLElement {
attribute boolean autoplay;
[CEReactions, SetterThrows]
attribute boolean loop;
[Throws]
[NewObject]
Promise<void> play();
[Throws]
void pause();
@ -204,7 +204,7 @@ partial interface HTMLMediaElement {
* event and an "ended" event.
*/
partial interface HTMLMediaElement {
[Throws, Pref="media.seekToNextFrame.enabled"]
[NewObject, Pref="media.seekToNextFrame.enabled"]
Promise<void> seekToNextFrame();
};
@ -273,7 +273,7 @@ partial interface HTMLMediaElement {
partial interface HTMLMediaElement {
[SecureContext, Pref="media.setsinkid.enabled"]
readonly attribute DOMString sinkId;
[Throws, SecureContext, Pref="media.setsinkid.enabled"]
[NewObject, SecureContext, Pref="media.setsinkid.enabled"]
Promise<void> setSinkId(DOMString sinkId);
};

Просмотреть файл

@ -63,7 +63,7 @@ partial interface HTMLVideoElement {
// installed in this <video>'s MediaDecoder, or selected video
// MediaStreamTrack, whichever is available first. Note that it might never
// resolve.
[Throws, Func="IsChromeOrUAWidget"]
[NewObject, Func="IsChromeOrUAWidget"]
Promise<void> cloneElementVisually(HTMLVideoElement target);
// Stops a <video> from cloning visually. Does nothing if the <video>

Просмотреть файл

@ -1,14 +1,14 @@
[SecureContext, Exposed=(Window,Worker), Pref="dom.weblocks.enabled"]
interface LockManager {
[Throws]
[NewObject]
Promise<any> request(DOMString name,
LockGrantedCallback callback);
[Throws]
[NewObject]
Promise<any> request(DOMString name,
LockOptions options,
LockGrantedCallback callback);
[Throws]
[NewObject]
Promise<LockManagerSnapshot> query();
};

Просмотреть файл

@ -17,15 +17,15 @@ interface MediaDevices : EventTarget {
attribute EventHandler ondevicechange;
MediaTrackSupportedConstraints getSupportedConstraints();
[Throws, UseCounter]
[NewObject, UseCounter]
Promise<sequence<MediaDeviceInfo>> enumerateDevices();
[Throws, NeedsCallerType, UseCounter]
[NewObject, NeedsCallerType, UseCounter]
Promise<MediaStream> getUserMedia(optional MediaStreamConstraints constraints = {});
// We need [SecureContext] in case media.devices.insecure.enabled = true
// because we don't want that legacy pref to expose this newer method.
[SecureContext, Pref="media.getdisplaymedia.enabled", Throws, NeedsCallerType, UseCounter]
[SecureContext, Pref="media.getdisplaymedia.enabled", NewObject, NeedsCallerType, UseCounter]
Promise<MediaStream> getDisplayMedia(optional DisplayMediaStreamConstraints constraints = {});
};
@ -35,6 +35,6 @@ dictionary AudioOutputOptions {
};
// https://w3c.github.io/mediacapture-output/#mediadevices-extensions
partial interface MediaDevices {
[SecureContext, Pref="media.setsinkid.enabled", Throws, NeedsCallerType]
[SecureContext, Pref="media.setsinkid.enabled", NewObject, NeedsCallerType]
Promise<MediaDeviceInfo> selectAudioOutput(optional AudioOutputOptions options = {});
};

Просмотреть файл

@ -46,6 +46,6 @@ interface MediaSource : EventTarget {
[Throws]
void clearLiveSeekableRange();
static boolean isTypeSupported(DOMString type);
[Throws, ChromeOnly]
[NewObject, ChromeOnly]
Promise<MediaSourceDecoderDebugInfo> mozDebugReaderData();
};

Просмотреть файл

@ -49,7 +49,7 @@ interface MediaStream : EventTarget {
attribute EventHandler onaddtrack;
attribute EventHandler onremovetrack;
[ChromeOnly, Throws]
[ChromeOnly, NewObject]
static Promise<long> countUnderlyingStreams();
// Webrtc allows the remote side to name a stream whatever it wants, and we

Просмотреть файл

@ -114,7 +114,7 @@ interface MediaStreamTrack : EventTarget {
[NeedsCallerType]
MediaTrackSettings getSettings ();
[Throws, NeedsCallerType]
[NewObject, NeedsCallerType]
Promise<void> applyConstraints (optional MediaTrackConstraints constraints = {});
// attribute EventHandler onoverconstrained;
};

Просмотреть файл

@ -215,7 +215,7 @@ partial interface Navigator {
// https://immersive-web.github.io/webvr/spec/1.1/#interface-navigator
partial interface Navigator {
[Throws, SecureContext, Pref="dom.vr.enabled"]
[NewObject, SecureContext, Pref="dom.vr.enabled"]
Promise<sequence<VRDisplay>> getVRDisplays();
// TODO: Use FrozenArray once available. (Bug 1236777)
[SecureContext, Frozen, Cached, Pure, Pref="dom.vr.enabled"]
@ -240,7 +240,7 @@ partial interface Navigator {
// http://webaudio.github.io/web-midi-api/#requestmidiaccess
partial interface Navigator {
[SecureContext, Throws, Pref="dom.webmidi.enabled"]
[SecureContext, NewObject, Pref="dom.webmidi.enabled"]
Promise<MIDIAccess> requestMIDIAccess(optional MIDIOptions options = {});
};
@ -315,7 +315,7 @@ partial interface Navigator {
// https://wicg.github.io/web-share/#navigator-interface
partial interface Navigator {
[SecureContext, Throws, Func="Navigator::HasShareSupport"]
[SecureContext, NewObject, Func="Navigator::HasShareSupport"]
Promise<void> share(optional ShareData data = {});
[SecureContext, Func="Navigator::HasShareSupport"]
boolean canShare(optional ShareData data = {});

Просмотреть файл

@ -20,10 +20,10 @@ interface Notification : EventTarget {
[GetterThrows]
static readonly attribute NotificationPermission permission;
[Throws, Func="mozilla::dom::Notification::RequestPermissionEnabledForScope"]
[NewObject, Func="mozilla::dom::Notification::RequestPermissionEnabledForScope"]
static Promise<NotificationPermission> requestPermission(optional NotificationPermissionCallback permissionCallback);
[Throws, Func="mozilla::dom::Notification::IsGetEnabled"]
[NewObject, Func="mozilla::dom::Notification::IsGetEnabled"]
static Promise<sequence<Notification>> get(optional GetNotificationOptions filter = {});
attribute EventHandler onclick;

Просмотреть файл

@ -25,7 +25,7 @@ interface OfflineAudioContext : BaseAudioContext {
constructor(unsigned long numberOfChannels, unsigned long length,
float sampleRate);
[Throws]
[NewObject]
Promise<AudioBuffer> startRendering();
// TODO: Promise<void> suspend (double suspendTime);

Просмотреть файл

@ -32,14 +32,14 @@ interface OffscreenCanvas : EventTarget {
[Throws]
ImageBitmap transferToImageBitmap();
[Throws]
[NewObject]
Promise<Blob> convertToBlob(optional ImageEncodeOptions options = {});
attribute EventHandler oncontextlost;
attribute EventHandler oncontextrestored;
// Deprecated by convertToBlob
[Deprecated="OffscreenCanvasToBlob", Throws]
[Deprecated="OffscreenCanvasToBlob", NewObject]
Promise<Blob> toBlob(optional DOMString type = "",
optional any encoderOptions);
};

Просмотреть файл

@ -25,8 +25,8 @@ dictionary PermissionDescriptor {
[Exposed=Window]
interface Permissions {
[Throws]
[NewObject]
Promise<PermissionStatus> query(object permission);
[Throws, Pref="dom.permissions.revoke.enable"]
[NewObject, Pref="dom.permissions.revoke.enable"]
Promise<PermissionStatus> revoke(object permission);
};

Просмотреть файл

@ -52,7 +52,7 @@ interface PushSubscription
readonly attribute EpochTimeStamp? expirationTime;
[Throws]
ArrayBuffer? getKey(PushEncryptionKeyName name);
[Throws, UseCounter]
[NewObject, UseCounter]
Promise<boolean> unsubscribe();
// Implements the custom serializer specified in Push API, section 9.

Просмотреть файл

@ -7,7 +7,7 @@ interface ReadableStream {
readonly attribute boolean locked;
[Throws]
[NewObject]
Promise<void> cancel(optional any reason);
[Throws]
@ -16,7 +16,7 @@ interface ReadableStream {
[Pref="dom.streams.transform_streams.enabled", Throws]
ReadableStream pipeThrough(ReadableWritablePair transform, optional StreamPipeOptions options = {});
[Pref="dom.streams.pipeTo.enabled", Throws]
[Pref="dom.streams.pipeTo.enabled", NewObject]
Promise<void> pipeTo(WritableStream destination, optional StreamPipeOptions options = {});
[Throws]

Просмотреть файл

@ -12,7 +12,7 @@ interface ReadableStreamBYOBReader {
[Throws]
constructor(ReadableStream stream);
[Throws]
[NewObject]
Promise<ReadableStreamReadResult> read(ArrayBufferView view);
[Throws]

Просмотреть файл

@ -15,7 +15,7 @@ enum ReadableStreamType { "bytes" };
interface mixin ReadableStreamGenericReader {
readonly attribute Promise<void> closed;
[Throws]
[NewObject]
Promise<void> cancel(optional any reason);
};
@ -25,7 +25,7 @@ interface ReadableStreamDefaultReader {
[Throws]
constructor(ReadableStream stream);
[Throws]
[NewObject]
Promise<ReadableStreamReadResult> read();
[Throws]

Просмотреть файл

@ -30,7 +30,7 @@ enum OrientationLockType {
[Exposed=Window]
interface ScreenOrientation : EventTarget {
[Throws]
[NewObject]
Promise<void> lock(OrientationLockType orientation);
[Throws]
void unlock();

Просмотреть файл

@ -47,8 +47,8 @@ partial interface ServiceWorkerRegistration {
// https://notifications.spec.whatwg.org/
partial interface ServiceWorkerRegistration {
[Throws, Pref="dom.webnotifications.serviceworker.enabled"]
[NewObject, Pref="dom.webnotifications.serviceworker.enabled"]
Promise<void> showNotification(DOMString title, optional NotificationOptions options = {});
[Throws, Pref="dom.webnotifications.serviceworker.enabled"]
[NewObject, Pref="dom.webnotifications.serviceworker.enabled"]
Promise<sequence<Notification>> getNotifications(optional GetNotificationOptions filter = {});
};

Просмотреть файл

@ -53,11 +53,11 @@ interface SourceBuffer : EventTarget {
partial interface SourceBuffer {
// Experimental function as proposed in:
// https://github.com/w3c/media-source/issues/100 for promise proposal.
[Throws, Pref="media.mediasource.experimental.enabled"]
[NewObject, Pref="media.mediasource.experimental.enabled"]
Promise<void> appendBufferAsync(ArrayBuffer data);
[Throws, Pref="media.mediasource.experimental.enabled"]
[NewObject, Pref="media.mediasource.experimental.enabled"]
Promise<void> appendBufferAsync(ArrayBufferView data);
[Throws, Pref="media.mediasource.experimental.enabled"]
[NewObject, Pref="media.mediasource.experimental.enabled"]
Promise<void> removeAsync(double start, unrestricted double end);
// Experimental function as proposed in:

Просмотреть файл

@ -12,13 +12,13 @@
Exposed=(Window,Worker),
Pref="dom.storageManager.enabled"]
interface StorageManager {
[Throws]
[NewObject]
Promise<boolean> persisted();
[Exposed=Window, Throws]
[Exposed=Window, NewObject]
Promise<boolean> persist();
[Throws]
[NewObject]
Promise<StorageEstimate> estimate();
};

Просмотреть файл

@ -183,58 +183,58 @@ typedef (object or DOMString) AlgorithmIdentifier;
[Exposed=(Window,Worker),
SecureContext]
interface SubtleCrypto {
[Throws]
[NewObject]
Promise<any> encrypt(AlgorithmIdentifier algorithm,
CryptoKey key,
BufferSource data);
[Throws]
[NewObject]
Promise<any> decrypt(AlgorithmIdentifier algorithm,
CryptoKey key,
BufferSource data);
[Throws]
[NewObject]
Promise<any> sign(AlgorithmIdentifier algorithm,
CryptoKey key,
BufferSource data);
[Throws]
[NewObject]
Promise<any> verify(AlgorithmIdentifier algorithm,
CryptoKey key,
BufferSource signature,
BufferSource data);
[Throws]
[NewObject]
Promise<any> digest(AlgorithmIdentifier algorithm,
BufferSource data);
[Throws]
[NewObject]
Promise<any> generateKey(AlgorithmIdentifier algorithm,
boolean extractable,
sequence<KeyUsage> keyUsages );
[Throws]
[NewObject]
Promise<any> deriveKey(AlgorithmIdentifier algorithm,
CryptoKey baseKey,
AlgorithmIdentifier derivedKeyType,
boolean extractable,
sequence<KeyUsage> keyUsages );
[Throws]
[NewObject]
Promise<any> deriveBits(AlgorithmIdentifier algorithm,
CryptoKey baseKey,
unsigned long length);
[Throws]
[NewObject]
Promise<any> importKey(KeyFormat format,
object keyData,
AlgorithmIdentifier algorithm,
boolean extractable,
sequence<KeyUsage> keyUsages );
[Throws]
[NewObject]
Promise<any> exportKey(KeyFormat format, CryptoKey key);
[Throws]
[NewObject]
Promise<any> wrapKey(KeyFormat format,
CryptoKey key,
CryptoKey wrappingKey,
AlgorithmIdentifier wrapAlgorithm);
[Throws]
[NewObject]
Promise<any> unwrapKey(KeyFormat format,
BufferSource wrappedKey,
CryptoKey unwrappingKey,

Просмотреть файл

@ -303,12 +303,12 @@ interface VRDisplay : EventTarget {
* Begin presenting to the VRDisplay. Must be called in response to a user gesture.
* Repeat calls while already presenting will update the VRLayers being displayed.
*/
[Throws, NeedsCallerType] Promise<void> requestPresent(sequence<VRLayer> layers);
[NewObject, NeedsCallerType] Promise<void> requestPresent(sequence<VRLayer> layers);
/**
* Stops presenting to the VRDisplay.
*/
[Throws] Promise<void> exitPresent();
[NewObject] Promise<void> exitPresent();
/**
* Get the layers currently being presented.

Просмотреть файл

@ -64,8 +64,8 @@ interface VRMockController {
interface VRServiceTest {
VRMockDisplay getVRDisplay();
[Throws] VRMockController getVRController(unsigned long controllerIdx);
[Throws] Promise<void> run();
[Throws] Promise<void> reset();
[NewObject] Promise<void> run();
[NewObject] Promise<void> reset();
void commit();
void end();
void clearAll();

Просмотреть файл

@ -169,9 +169,9 @@ interface GPUDevice: EventTarget {
GPUComputePipeline createComputePipeline(GPUComputePipelineDescriptor descriptor);
GPURenderPipeline createRenderPipeline(GPURenderPipelineDescriptor descriptor);
[Throws]
[NewObject]
Promise<GPUComputePipeline> createComputePipelineAsync(GPUComputePipelineDescriptor descriptor);
[Throws]
[NewObject]
Promise<GPURenderPipeline> createRenderPipelineAsync(GPURenderPipelineDescriptor descriptor);
[NewObject]

Просмотреть файл

@ -11,7 +11,7 @@
[Pref="dom.vr.webxr.enabled", SecureContext, Exposed=Window]
interface XRSystem : EventTarget {
// Methods
[Throws]
[NewObject]
Promise<boolean> isSessionSupported(XRSessionMode mode);
[NewObject, NeedsCallerType]
Promise<XRSession> requestSession(XRSessionMode mode, optional XRSessionInit options = {});
@ -55,7 +55,7 @@ interface XRSession : EventTarget {
[Throws]
void cancelAnimationFrame(long handle);
[Throws]
[NewObject]
Promise<void> end();
// Events

Просмотреть файл

@ -717,7 +717,7 @@ partial interface Window {
* @param {function} callback
* @returns {Promise}
*/
[Throws, Func="nsGlobalWindowInner::IsPrivilegedChromeWindow"]
[NewObject, Func="nsGlobalWindowInner::IsPrivilegedChromeWindow"]
Promise<any> promiseDocumentFlushed(PromiseDocumentFlushedCallback callback);
[ChromeOnly]

Просмотреть файл

@ -20,7 +20,7 @@ interface WritableStream {
[Throws]
Promise<void> abort(optional any reason);
[Throws]
[NewObject]
Promise<void> close();
[Throws]

Просмотреть файл

@ -19,12 +19,12 @@ interface WritableStreamDefaultWriter {
[Throws]
Promise<void> abort(optional any reason);
[Throws]
[NewObject]
Promise<void> close();
[Throws]
void releaseLock();
[Throws]
[NewObject]
Promise<void> write(optional any chunk);
};