Backed out changeset 00bb04b8c9a0 (bug 1255040) for failures in browser_webapi.js
authorWes Kocher <wkocher@mozilla.com>
Tue, 19 Apr 2016 16:37:08 -0700
changeset 331648 f60bd9567a058bf0d4d5b35f0d53a46eba0aa500
parent 331647 036c763dedca215c00853146dc050a766dfd1f04
child 331649 dece9231ef6cfdd1d34074da3af8925530bfec5f
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1255040
milestone48.0a1
backs out00bb04b8c9a0495fe026f609b18e09835e49c927
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
Backed out changeset 00bb04b8c9a0 (bug 1255040) for failures in browser_webapi.js MozReview-Commit-ID: 1qKiUTNw4fV
dom/webidl/AddonManager.webidl
toolkit/mozapps/extensions/amWebAPI.js
--- a/dom/webidl/AddonManager.webidl
+++ b/dom/webidl/AddonManager.webidl
@@ -1,16 +1,15 @@
 /* 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/.
  */
 
-/* We need a JSImplementation but cannot get one without a contract ID.
-   Since Addon and AddonInstall are only ever created from JS they don't need
-   real contract IDs. */
+/* We need a JSImplementation but cannot get one without a contract ID. Since
+   This object is only ever created from JS we don't need a real contract ID. */
 [ChromeOnly, JSImplementation="dummy"]
 interface Addon {
   // The add-on's ID.
   readonly attribute DOMString id;
   // The add-on's version.
   readonly attribute DOMString version;
   // The add-on's type (extension, theme, etc.).
   readonly attribute DOMString type;
@@ -19,54 +18,24 @@ interface Addon {
   // The add-on's description in the current locale.
   readonly attribute DOMString description;
   // If the user has enabled this add-on, note that it still may not be running
   // depending on whether enabling requires a restart or if the add-on is
   // incompatible in some way.
   readonly attribute boolean isEnabled;
   // If the add-on is currently active in the browser.
   readonly attribute boolean isActive;
-
-  Promise<boolean> uninstall();
-};
-
-[ChromeOnly, JSImplementation="dummy"]
-interface AddonInstall : EventTarget {
-  // One of the STATE_* symbols from AddonManager.jsm
-  readonly attribute DOMString state;
-  // One of the ERROR_* symbols from AddonManager.jsm, or null
-  readonly attribute DOMString? error;
-  // How many bytes have been downloaded
-  readonly attribute long long progress;
-  // How many total bytes will need to be downloaded or -1 if unknown
-  readonly attribute long long maxProgress;
-
-  Promise<void> install();
-  Promise<void> cancel();
-};
-
-dictionary addonInstallOptions {
-  required DOMString url;
 };
 
 [HeaderFile="mozilla/AddonManagerWebAPI.h",
  Func="mozilla::AddonManagerWebAPI::IsAPIEnabled",
  NavigatorProperty="mozAddonManager",
  JSImplementation="@mozilla.org/addon-web-api/manager;1"]
 interface AddonManager {
   /**
    * Gets information about an add-on
    *
    * @param  id
    *         The ID of the add-on to test for.
    * @return A promise. It will resolve to an Addon if the add-on is installed.
    */
   Promise<Addon> getAddonByID(DOMString id);
-
-  /**
-   * Creates an AddonInstall object for a given URL.
-   *
-   * @param options
-   *        Only one supported option: 'url', the URL of the addon to install.
-   * @return A promise that resolves to an instance of AddonInstall.
-   */
-  Promise<AddonInstall> createInstall(optional addonInstallOptions options);
 };
--- a/toolkit/mozapps/extensions/amWebAPI.js
+++ b/toolkit/mozapps/extensions/amWebAPI.js
@@ -50,26 +50,21 @@ const APIBroker = {
       this._promises.set(callbackID, { resolve, reject });
       Services.cpmm.sendAsyncMessage(MSG_PROMISE_REQUEST, { type, callbackID, args });
     });
   },
 };
 
 APIBroker.init();
 
-function Addon(win, properties) {
+function Addon(properties) {
   // We trust the webidl binding to broker access to our properties.
   for (let key of Object.keys(properties)) {
     this[key] = properties[key];
   }
-
-  this.uninstall = function() {
-    let err = new win.Error("not yet implemented");
-    return win.Promise.reject(err);
-  };
 }
 
 /**
  * API methods should return promises from the page, this is a simple wrapper
  * to make sure of that. It also automatically wraps objects when necessary.
  */
 function WebAPITask(generator) {
   let task = Task.async(generator);
@@ -97,22 +92,17 @@ function WebAPI() {
 
 WebAPI.prototype = {
   init(window) {
     this.window = window;
   },
 
   getAddonByID: WebAPITask(function*(id) {
     let addonInfo = yield APIBroker.sendRequest("getAddonByID", id);
-    return addonInfo ? new Addon(this.window, addonInfo) : null;
+    return addonInfo ? new Addon(addonInfo) : null;
   }),
 
-  createInstall() {
-    let err = new this.window.Error("not yet implemented");
-    return this.window.Promise.reject(err);
-  },
-
   classID: Components.ID("{8866d8e3-4ea5-48b7-a891-13ba0ac15235}"),
   contractID: "@mozilla.org/addon-web-api/manager;1",
   QueryInterface: XPCOMUtils.generateQI([Ci.nsISupports, Ci.nsIDOMGlobalPropertyInitializer])
 };
 
 this.NSGetFactory = XPCOMUtils.generateNSGetFactory([WebAPI]);