Bug 1113827 part 2. Remove some now-unnecessary [Throws] annotations in our IDL. r=peterv
authorBoris Zbarsky <bzbarsky@mit.edu>
Mon, 12 Jan 2015 11:52:25 -0500
changeset 249204 560fcd0679e8e83d0d41dfe647a8fa2513f22699
parent 249203 7e3abaf18602116c8f643a790f6e93c597010e35
child 249205 7967b585efe9717dbbb991a46609c62d7d56d922
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspeterv
bugs1113827
milestone37.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1113827 part 2. Remove some now-unnecessary [Throws] annotations in our IDL. r=peterv
dom/webidl/BluetoothAdapter2.webidl
dom/webidl/BluetoothDevice2.webidl
dom/webidl/BluetoothPairingHandle.webidl
dom/webidl/DOMRequest.webidl
dom/webidl/DeviceStorage.webidl
dom/webidl/Directory.webidl
dom/webidl/HTMLMediaElement.webidl
dom/webidl/MediaKeySession.webidl
dom/webidl/MediaKeySystemAccess.webidl
dom/webidl/MediaKeys.webidl
dom/webidl/MozIcc.webidl
dom/webidl/Navigator.webidl
dom/webidl/Promise.webidl
dom/webidl/TelephonyCall.webidl
dom/webidl/TelephonyCallGroup.webidl
dom/webidl/TextEncoder.webidl
dom/webidl/USSDSession.webidl
--- a/dom/webidl/BluetoothAdapter2.webidl
+++ b/dom/webidl/BluetoothAdapter2.webidl
@@ -67,34 +67,34 @@ interface BluetoothAdapter : EventTarget
 
   /**
    * Enable/Disable a local bluetooth adapter by asynchronus methods and return
    * its result through a Promise.
    *
    * Several onattributechanged events would be triggered during processing the
    * request, and the last one indicates adapter.state becomes enabled/disabled.
    */
-  [NewObject, Throws]
+  [NewObject]
   Promise<void> enable();
-  [NewObject, Throws]
+  [NewObject]
   Promise<void> disable();
 
-  [NewObject, Throws]
+  [NewObject]
   Promise<void> setName(DOMString aName);
-  [NewObject, Throws]
+  [NewObject]
   Promise<void> setDiscoverable(boolean aDiscoverable);
 
-  [NewObject, Throws]
+  [NewObject]
   Promise<BluetoothDiscoveryHandle> startDiscovery();
-  [NewObject, Throws]
+  [NewObject]
   Promise<void> stopDiscovery();
 
-  [NewObject, Throws]
+  [NewObject]
   Promise<void> pair(DOMString deviceAddress);
-  [NewObject, Throws]
+  [NewObject]
   Promise<void> unpair(DOMString deviceAddress);
 
   sequence<BluetoothDevice> getPairedDevices();
 
   [NewObject, Throws, AvailableIn=CertifiedApps]
   DOMRequest getConnectedDevices(unsigned short serviceUuid);
 
   /**
--- a/dom/webidl/BluetoothDevice2.webidl
+++ b/dom/webidl/BluetoothDevice2.webidl
@@ -21,17 +21,17 @@ interface BluetoothDevice : EventTarget
 
   /**
    * Fetch the up-to-date UUID list of each bluetooth service that the device
    * provides and refresh the cache value of attribute uuids if it is updated.
    *
    * If the operation succeeds, the promise will be resolved with up-to-date
    * UUID list which is identical to attribute uuids.
    */
-  [NewObject, Throws]
+  [NewObject]
   Promise<sequence<DOMString>>              fetchUuids();
 };
 
 enum BluetoothDeviceType
 {
   "unknown",
   "classic",
   "le",
--- a/dom/webidl/BluetoothPairingHandle.webidl
+++ b/dom/webidl/BluetoothPairingHandle.webidl
@@ -8,13 +8,13 @@ interface BluetoothPairingHandle
 {
   /**
    * A 6-digit string ranging from decimal 000000 to 999999.
    * This attribute is an empty string for enterpincodereq and
    * pairingconsentreq.
    */
   readonly attribute DOMString passkey;
 
-  [NewObject, Throws]
+  [NewObject]
   Promise<void> setPinCode(DOMString aPinCode);
-  [NewObject, Throws]
+  [NewObject]
   Promise<void> setPairingConfirmation(boolean aConfirm);
 };
--- a/dom/webidl/DOMRequest.webidl
+++ b/dom/webidl/DOMRequest.webidl
@@ -14,14 +14,14 @@ interface DOMRequestShared {
 
   attribute EventHandler onsuccess;
   attribute EventHandler onerror;
 };
 
 interface DOMRequest : EventTarget {
   // The [TreatNonCallableAsNull] annotation is required since then() should do
   // nothing instead of throwing errors when non-callable arguments are passed.
-  [NewObject, Throws]
+  [NewObject]
   Promise<any> then([TreatNonCallableAsNull] optional AnyCallback? fulfillCallback = null,
                     [TreatNonCallableAsNull] optional AnyCallback? rejectCallback = null);
 };
 
 DOMRequest implements DOMRequestShared;
--- a/dom/webidl/DeviceStorage.webidl
+++ b/dom/webidl/DeviceStorage.webidl
@@ -81,12 +81,12 @@ interface DeviceStorage : EventTarget {
 
   // Determines if this storage area is the one which will be used by default
   // for storing new files.
   readonly attribute boolean default;
 
   // Indicates if the storage area denoted by storageName is removable
   readonly attribute boolean isRemovable;
 
-  [NewObject, Throws]
+  [NewObject]
   // XXXbz what type does this really return?
   Promise<any> getRoot();
 };
--- a/dom/webidl/Directory.webidl
+++ b/dom/webidl/Directory.webidl
@@ -30,68 +30,68 @@ interface Directory {
    * a new file to replace the existing one;
    * If 'ifExists' is 'replace', the path already exists, but is a directory,
    * createFile must fail.
    * Otherwise, if no other error occurs, createFile will create a new file.
    * The 'data' property contains the new file's content.
    * @return If succeeds, the promise is resolved with the new created
    * File object. Otherwise, rejected with a DOM error.
    */
-  [NewObject, Throws]
+  [NewObject]
   Promise<File> createFile(DOMString path, optional CreateFileOptions options);
 
   /*
    * Creates a descendent directory. This method will create any intermediate
    * directories specified by the path segments.
    *
    * @param path The relative path of the new directory to current directory.
    * If path exists, createDirectory must fail.
    * @return If succeeds, the promise is resolved with the new created
    * Directory object. Otherwise, rejected with a DOM error.
    */
-  [NewObject, Throws]
+  [NewObject]
   Promise<Directory> createDirectory(DOMString path);
 
   /*
    * Gets a descendent file or directory with the given path.
    *
    * @param path The descendent entry's relative path to current directory.
    * @return If the path exists and no error occurs, the promise is resolved
    * with a File or Directory object, depending on the entry's type. Otherwise,
    * rejected with a DOM error.
    */
-  [NewObject, Throws]
+  [NewObject]
   Promise<(File or Directory)> get(DOMString path);
 
   /*
    * Deletes a file or an empty directory. The target must be a descendent of
    * current directory.
    * @param path If a DOM string is passed, it is the relative path of the
    * target. Otherwise, the File or Directory object of the target should be
    * passed.
    * @return If the target is a non-empty directory, or if deleting the target
    * fails, the promise is rejected with a DOM error. If the target did not
    * exist, the promise is resolved with boolean false. If the target did exist
    * and was successfully deleted, the promise is resolved with boolean true.
    */
-  [NewObject, Throws]
+  [NewObject]
   Promise<boolean> remove((DOMString or File or Directory) path);
 
   /*
    * Deletes a file or a directory recursively. The target should be a
    * descendent of current directory.
    * @param path If a DOM string is passed, it is the relative path of the
    * target. Otherwise, the File or Directory object of the target should be
    * passed.
    * @return If the target exists, but deleting the target fails, the promise is
    * rejected with a DOM error. If the target did not exist, the promise is
    * resolved with boolean false. If the target did exist and was successfully
    * deleted, the promise is resolved with boolean true.
    */
-  [NewObject, Throws]
+  [NewObject]
   Promise<boolean> removeDeep((DOMString or File or Directory) path);
 };
 
 enum CreateIfExistsMode { "replace", "fail" };
 
 dictionary CreateFileOptions {
   CreateIfExistsMode ifExists = "fail";
   (DOMString or Blob or ArrayBuffer or ArrayBufferView) data;
--- a/dom/webidl/HTMLMediaElement.webidl
+++ b/dom/webidl/HTMLMediaElement.webidl
@@ -146,17 +146,17 @@ enum MediaWaitingFor {
 
 #ifdef MOZ_EME
 // Encrypted Media Extensions
 partial interface HTMLMediaElement {
   [Pref="media.eme.enabled"]
   readonly attribute MediaKeys? mediaKeys;
 
   // void, not any: https://www.w3.org/Bugs/Public/show_bug.cgi?id=26457
-  [Pref="media.eme.enabled", Throws, NewObject]
+  [Pref="media.eme.enabled", NewObject]
   Promise<void> setMediaKeys(MediaKeys? mediaKeys);
 
   [Pref="media.eme.enabled"]
   attribute EventHandler onencrypted;
 
   [Pref="media.eme.enabled"]
   readonly attribute MediaWaitingFor waitingFor;
 };
--- a/dom/webidl/MediaKeySession.webidl
+++ b/dom/webidl/MediaKeySession.webidl
@@ -18,27 +18,27 @@ interface MediaKeySession : EventTarget 
   // session properties
   readonly attribute DOMString keySystem;
   readonly attribute DOMString sessionId;
 
   readonly attribute unrestricted double expiration;
 
   readonly attribute Promise<void> closed;
 
-  [NewObject, Throws]
+  [NewObject]
   Promise<void> generateRequest(DOMString initDataType, (ArrayBufferView or ArrayBuffer) initData);
 
-  [NewObject, Throws]
+  [NewObject]
   Promise<boolean> load(DOMString sessionId);
 
   // session operations
-  [NewObject, Throws]
+  [NewObject]
   Promise<void> update((ArrayBufferView or ArrayBuffer) response);
 
-  [NewObject, Throws]
+  [NewObject]
   Promise<void> close();
 
-  [NewObject, Throws]
+  [NewObject]
   Promise<void> remove();
 
-  [NewObject, Throws]
+  [NewObject]
   Promise<sequence<ArrayBuffer>> getUsableKeyIds();
 };
--- a/dom/webidl/MediaKeySystemAccess.webidl
+++ b/dom/webidl/MediaKeySystemAccess.webidl
@@ -24,11 +24,11 @@ dictionary MediaKeySystemOptions {
   DOMString            videoCapability = "";
   MediaKeysRequirement uniqueidentifier = "optional";
   MediaKeysRequirement stateful = "optional";
 };
 
 [Pref="media.eme.enabled"]
 interface MediaKeySystemAccess {
   readonly    attribute DOMString keySystem;
-  [NewObject, Throws]
+  [NewObject]
   Promise<MediaKeys> createMediaKeys();
 };
--- a/dom/webidl/MediaKeys.webidl
+++ b/dom/webidl/MediaKeys.webidl
@@ -15,11 +15,11 @@ enum SessionType { "temporary", "persist
 
 [Pref="media.eme.enabled"]
 interface MediaKeys {
   readonly attribute DOMString keySystem;
 
   [NewObject, Throws]
   MediaKeySession createSession(optional SessionType sessionType = "temporary");
 
-  [NewObject, Throws]
+  [NewObject]
   Promise<void> setServerCertificate((ArrayBufferView or ArrayBuffer) serverCertificate);
 };
--- a/dom/webidl/MozIcc.webidl
+++ b/dom/webidl/MozIcc.webidl
@@ -346,11 +346,11 @@ interface MozIcc : EventTarget
    *
    * @param service
    *        Identifies the service type.
    *
    * @return a Promise
    *         If succeeds, the promise is resolved with boolean indicating the
    *         availability of the service. Otherwise, rejected with a DOMError.
    */
-  [NewObject, Throws]
+  [NewObject]
   Promise<boolean> getServiceState(IccService service);
 };
--- a/dom/webidl/Navigator.webidl
+++ b/dom/webidl/Navigator.webidl
@@ -127,17 +127,17 @@ interface NavigatorBattery {
     readonly attribute BatteryManager? battery;
 };
 Navigator implements NavigatorBattery;
 
 // https://wiki.mozilla.org/WebAPI/DataStore
 [NoInterfaceObject,
  Exposed=(Window,Worker)]
 interface NavigatorDataStore {
-    [Throws, NewObject, Func="Navigator::HasDataStoreSupport"]
+    [NewObject, Func="Navigator::HasDataStoreSupport"]
     Promise<sequence<DataStore>> getDataStores(DOMString name,
                                                optional DOMString? owner = null);
 };
 Navigator implements NavigatorDataStore;
 
 // http://www.w3.org/TR/vibration/#vibration-interface
 partial interface Navigator {
     // We don't support sequences in unions yet
@@ -168,17 +168,17 @@ dictionary MobileIdOptions {
 };
 
 [NoInterfaceObject]
 interface NavigatorMobileId {
     // Ideally we would use [CheckPermissions] here, but the "mobileid"
     // permission is set to PROMPT_ACTION and [CheckPermissions] only checks
     // for ALLOW_ACTION.
     // XXXbz what is this promise resolved with?
-    [Throws, NewObject, Func="Navigator::HasMobileIdSupport"]
+    [NewObject, Func="Navigator::HasMobileIdSupport"]
     Promise<any> getMobileIdAssertion(optional MobileIdOptions options);
 };
 Navigator implements NavigatorMobileId;
 #endif // MOZ_B2G
 
 // nsIDOMNavigator
 partial interface Navigator {
   [Throws]
@@ -400,14 +400,14 @@ partial interface Navigator {
 
 partial interface Navigator {
   [Pref="dom.tv.enabled", CheckPermissions="tv", Func="Navigator::HasTVSupport"]
   readonly attribute TVManager? tv;
 };
 
 #ifdef MOZ_EME
 partial interface Navigator {
-  [Pref="media.eme.enabled", Throws, NewObject]
+  [Pref="media.eme.enabled", NewObject]
   Promise<MediaKeySystemAccess>
   requestMediaKeySystemAccess(DOMString keySystem,
                               optional sequence<MediaKeySystemOptions> supportedConfigurations);
 };
 #endif
--- a/dom/webidl/Promise.webidl
+++ b/dom/webidl/Promise.webidl
@@ -22,28 +22,28 @@ callback AnyCallback = any (any value);
 interface _Promise {
   // TODO bug 875289 - static Promise fulfill(any value);
 
   // Disable the static methods when the interface object is supposed to be
   // disabled, just in case some code decides to walk over to .constructor from
   // the proto of a promise object or someone screws up and manages to create a
   // Promise object in this scope without having resolved the interface object
   // first.
-  [NewObject, Throws]
+  [NewObject]
   static Promise<any> resolve(optional any value);
-  [NewObject, Throws]
+  [NewObject]
   static Promise<void> reject(optional any value);
 
   // The [TreatNonCallableAsNull] annotation is required since then() should do
   // nothing instead of throwing errors when non-callable arguments are passed.
-  [NewObject, Throws]
+  [NewObject]
   Promise<any> then([TreatNonCallableAsNull] optional AnyCallback? fulfillCallback = null,
                     [TreatNonCallableAsNull] optional AnyCallback? rejectCallback = null);
 
-  [NewObject, Throws]
+  [NewObject]
   Promise<any> catch([TreatNonCallableAsNull] optional AnyCallback? rejectCallback = null);
 
-  [NewObject, Throws]
+  [NewObject]
   static Promise<any> all(sequence<any> iterable);
 
-  [NewObject, Throws]
+  [NewObject]
   static Promise<any> race(sequence<any> iterable);
 };
--- a/dom/webidl/TelephonyCall.webidl
+++ b/dom/webidl/TelephonyCall.webidl
@@ -28,23 +28,23 @@ interface TelephonyCall : EventTarget {
 
   // Indicate whether the call can be added into TelephonyCallGroup.
   readonly attribute boolean mergeable;
 
   readonly attribute DOMError? error;
 
   readonly attribute TelephonyCallGroup? group;
 
-  [NewObject, Throws]
+  [NewObject]
   Promise<void> answer();
-  [NewObject, Throws]
+  [NewObject]
   Promise<void> hangUp();
-  [NewObject, Throws]
+  [NewObject]
   Promise<void> hold();
-  [NewObject, Throws]
+  [NewObject]
   Promise<void> resume();
 
   attribute EventHandler onstatechange;
   attribute EventHandler ondialing;
   attribute EventHandler onalerting;
   attribute EventHandler onconnecting;
   attribute EventHandler onconnected;
   attribute EventHandler ondisconnecting;
--- a/dom/webidl/TelephonyCallGroup.webidl
+++ b/dom/webidl/TelephonyCallGroup.webidl
@@ -12,17 +12,17 @@ interface TelephonyCallGroup : EventTarg
   void add(TelephonyCall call);
 
   [Throws]
   void add(TelephonyCall call, TelephonyCall secondCall);
 
   [Throws]
   void remove(TelephonyCall call);
 
-  [NewObject, Throws]
+  [NewObject]
   Promise<void> hangUp();
 
   [Throws]
   void hold();
 
   [Throws]
   void resume();
 
--- a/dom/webidl/TextEncoder.webidl
+++ b/dom/webidl/TextEncoder.webidl
@@ -10,11 +10,11 @@
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 [Constructor(optional DOMString utfLabel = "utf-8"),
  Exposed=(Window,Worker,System)]
 interface TextEncoder {
   [Constant]
   readonly attribute DOMString encoding;
-  [Throws, NewObject]
+  [NewObject]
   Uint8Array encode(optional USVString input = "");
 };
--- a/dom/webidl/USSDSession.webidl
+++ b/dom/webidl/USSDSession.webidl
@@ -4,14 +4,14 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
 [Pref="dom.telephony.enabled",
  CheckPermissions="telephony",
  AvailableIn="CertifiedApps",
  Constructor(unsigned long serviceId)]
 interface USSDSession {
-  [NewObject, Throws]
+  [NewObject]
   Promise<void> send(DOMString ussd);
 
-  [NewObject, Throws]
+  [NewObject]
   Promise<void> cancel();
 };