Bug 910911 - Add more application data to the webapp.json file in the installation directory. r=fabrice, r=myk
authorMarco Castelluccio <mar.castelluccio@studenti.unina.it>
Fri, 13 Sep 2013 08:32:46 -0400
changeset 160025 6fbeefd180438db1a8f9f6d80d44bb813c3efb0b
parent 160024 eed90fa753001967d230dcab150cb005e2e66e65
child 160026 32fe88d6063fa0d88a6dc56dcefbdbc2312d34c6
push id2961
push userlsblakk@mozilla.com
push dateMon, 28 Oct 2013 21:59:28 +0000
treeherdermozilla-beta@73ef4f13486f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfabrice, myk
bugs910911
milestone26.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 910911 - Add more application data to the webapp.json file in the installation directory. r=fabrice, r=myk
toolkit/webapps/WebappsInstaller.jsm
--- a/toolkit/webapps/WebappsInstaller.jsm
+++ b/toolkit/webapps/WebappsInstaller.jsm
@@ -121,20 +121,21 @@ NativeApp.prototype = {
    * This function reads and parses the data from the app
    * manifest and stores it in the NativeApp object.
    *
    * @param aData the data object provided to the install function
    * @param aManifest the manifest data provided by the web app
    *
    */
   init: function(aData, aManifest) {
+    let app = aData.app;
     let manifest = this.manifest = new ManifestHelper(aManifest,
-                                                      aData.app.origin);
+                                                      app.origin);
 
-    let origin = Services.io.newURI(aData.app.origin, null, null);
+    let origin = Services.io.newURI(app.origin, null, null);
 
     let biggestIcon = getBiggestIconURL(manifest.icons);
     try {
       let iconURI = Services.io.newURI(biggestIcon, null, null);
       if (iconURI.scheme == "data") {
         this.iconURI = iconURI;
       }
     } catch (ex) {}
@@ -164,31 +165,47 @@ NativeApp.prototype = {
       let shortDesc = firstLine.length <= 256
                       ? firstLine
                       : firstLine.substr(0, 253) + "…";
       this.shortDescription = sanitize(shortDesc);
     } else {
       this.shortDescription = this.appName;
     }
 
-    this.categories = aData.app.categories.slice(0);
+    this.categories = app.categories.slice(0);
 
     // The app registry is the Firefox profile from which the app
     // was installed.
     let registryFolder = Services.dirsvc.get("ProfD", Ci.nsIFile);
 
     this.webappJson = {
       "registryDir": registryFolder.path,
       "app": {
         "manifest": aManifest,
-        "origin": aData.app.origin,
-        "manifestURL": aData.app.manifestURL
+        "origin": app.origin,
+        "manifestURL": app.manifestURL,
+        "installOrigin": app.installOrigin,
+        "categories": app.categories,
+        "receipts": app.receipts,
+        "installTime": app.installTime,
       }
     };
 
+    if (app.etag) {
+      this.webappJson.app.etag = app.etag;
+    }
+
+    if (app.packageEtag) {
+      this.webappJson.app.packageEtag = app.packageEtag;
+    }
+
+    if (app.updateManifest) {
+      this.webappJson.app.updateManifest = app.updateManifest;
+    }
+
     this.runtimeFolder = Services.dirsvc.get("GreD", Ci.nsIFile);
   },
 
   /**
    * This function retrieves the icon for an app.
    * If the retrieving fails, it uses the default chrome icon.
    */
   getIcon: function() {