Merge last PGO-green changeset of mozilla-inbound to mozilla-central a=merge
authorEd Morley <emorley@mozilla.com>
Mon, 23 Apr 2012 07:40:39 +0100
changeset 95422 e29b3d77f80802e46c3a0b5f1d78330a76b59ca5
parent 95418 bd9cdcd353e63ea3a1a0e22e937a1c180480aa64 (current diff)
parent 95421 133c3b95125fc89138885f6ee4cd46d35739ea4f (diff)
child 95423 6b26bdffa1bc8e79d72bc9986764177f1c914c3b
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone14.0a1
first release with
nightly linux32
e29b3d77f808 / 14.0a1 / 20120423030700 / files
nightly linux64
e29b3d77f808 / 14.0a1 / 20120423030700 / files
nightly mac
e29b3d77f808 / 14.0a1 / 20120423030700 / files
nightly win32
e29b3d77f808 / 14.0a1 / 20120423030700 / files
nightly win64
e29b3d77f808 / 14.0a1 / 20120423030700 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge last PGO-green changeset of mozilla-inbound to mozilla-central a=merge
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -152,17 +152,17 @@ XPCOMUtils.defineLazyGetter(window, "gFi
   return this.PluralForm;
 });
 __defineSetter__("PluralForm", function (val) {
   delete this.PluralForm;
   return this.PluralForm = val;
 });
 
 XPCOMUtils.defineLazyModuleGetter(this, "TelemetryStopwatch",
-                                  "resource:///modules/TelemetryStopwatch.jsm");
+                                  "resource://gre/modules/TelemetryStopwatch.jsm");
 
 #ifdef MOZ_SERVICES_SYNC
 XPCOMUtils.defineLazyGetter(this, "Weave", function() {
   let tmp = {};
   Cu.import("resource://services-sync/main.js", tmp);
   return tmp.Weave;
 });
 #endif
--- a/browser/modules/WebappsIconHelpers.js
+++ b/browser/modules/WebappsIconHelpers.js
@@ -100,10 +100,12 @@ function getIconForApp(aShell, callback)
   } catch(e) {
     throw("getIconFromURI - Failure getting icon (" + e + ")");
   }
 }
 
 function onIconDownloaded(aShell, aMimeType, aStatusCode, aIcon, aCallback) {
   if (Components.isSuccessCode(aStatusCode)) {
     aShell.processIcon(aMimeType, aIcon, aCallback);
+  } else {
+    aCallback.call(aShell);
   }
 }
--- a/browser/modules/WebappsInstaller.jsm
+++ b/browser/modules/WebappsInstaller.jsm
@@ -3,19 +3,19 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 let EXPORTED_SYMBOLS = ["WebappsInstaller"];
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cu = Components.utils;
 
-Cu.import("resource:///modules/Services.jsm");
-Cu.import("resource:///modules/FileUtils.jsm");
-Cu.import("resource:///modules/NetUtil.jsm");
+Cu.import("resource://gre/modules/Services.jsm");
+Cu.import("resource://gre/modules/FileUtils.jsm");
+Cu.import("resource://gre/modules/NetUtil.jsm");
 
 let WebappsInstaller = {
   /**
    * Creates a native installation of the web app in the OS
    *
    * @param aData the manifest data provided by the web app
    *
    * @returns bool true on success, false if an error was thrown
@@ -490,17 +490,17 @@ MacNativeApp.prototype = {
       this._createDirectoryStructure();
       this._copyPrebuiltFiles();
       this._createConfigFiles();
     } catch (ex) {
       this._removeInstallation(false);
       throw(ex);
     }
 
-    getIconForApp(this);
+    getIconForApp(this, this._createPListFile);
   },
 
   _removeInstallation: function(keepProfile) {
     try {
       if(this.installDir.exists()) {
         this.installDir.followLinks = false;
         this.installDir.remove(true);
       }
@@ -556,17 +556,20 @@ MacNativeApp.prototype = {
 
     let factory = Cc["@mozilla.org/xpcom/ini-processor-factory;1"]
                     .getService(Ci.nsIINIParserFactory);
 
     let writer = factory.createINIParser(applicationINI).QueryInterface(Ci.nsIINIParserWriter);
     writer.setString("Webapp", "Name", this.appName);
     writer.setString("Webapp", "Profile", this.appProfileDir.leafName);
     writer.writeFile();
+  },
 
+  _createPListFile: function() {
+    // ${InstallDir}/Contents/Info.plist
     let infoPListContent = '<?xml version="1.0" encoding="UTF-8"?>\n\
 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">\n\
 <plist version="1.0">\n\
   <dict>\n\
     <key>CFBundleDevelopmentRegion</key>\n\
     <string>English</string>\n\
     <key>CFBundleDisplayName</key>\n\
     <string>' + escapeXML(this.appName) + '</string>\n\
@@ -611,33 +614,35 @@ MacNativeApp.prototype = {
    * the URL by getIconForApp(). This will bundle the icon to the
    * app package at Contents/Resources/appicon.icns.
    *
    * @param aMimeType     the icon mimetype
    * @param aImageStream  the stream for the image data
    * @param aCallback     a callback function to be called
    *                      after the process finishes
    */
-  processIcon: function(aMimeType, aIcon) {
+  processIcon: function(aMimeType, aIcon, aCallback) {
     try {
       let process = Cc["@mozilla.org/process/util;1"]
                     .createInstance(Ci.nsIProcess);
       let sipsFile = Cc["@mozilla.org/file/local;1"]
                     .createInstance(Ci.nsILocalFile);
       sipsFile.initWithPath("/usr/bin/sips");
 
       process.init(sipsFile);
       process.run(true, ["-s",
                   "format", "icns",
                   aIcon.path,
                   "--out", this.iconFile.path,
                   "-z", "128", "128"],
                   9);
     } catch(e) {
       throw(e);
+    } finally {
+      aCallback.call(this);
     }
   }
 
 }
 
 #endif
 
 /* Helper Functions */
--- a/browser/modules/webappsUI.jsm
+++ b/browser/modules/webappsUI.jsm
@@ -6,17 +6,17 @@ let EXPORTED_SYMBOLS = ["webappsUI"];
 
 let Ci = Components.interfaces;
 let Cc = Components.classes;
 let Cu = Components.utils;
 
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/Webapps.jsm");
-Cu.import("resource://gre/modules/WebappsInstaller.jsm");
+Cu.import("resource:///modules/WebappsInstaller.jsm");
 
 let webappsUI = {
   init: function webappsUI_init() {
     Services.obs.addObserver(this, "webapps-ask-install", false);
     Services.obs.addObserver(this, "webapps-launch", false);
   },
   
   uninit: function webappsUI_uninit() {