about:startup - remove some debug logging, and add some comments
authorDaniel Brooks <db48x@db48x.net>
Sat, 18 Sep 2010 16:41:46 -0400
changeset 58848 3d74b68d15c9cd86737ad50f0276f5dedc60cd62
parent 58847 07b80de79428b8830a17eb753012a3721ba9a493
child 58849 9230d155978deaa4773a91c2c64f4a398ad6aaf5
push id1
push usershaver@mozilla.com
push dateTue, 04 Jan 2011 17:58:04 +0000
milestone2.0b6pre
about:startup - remove some debug logging, and add some comments
toolkit/content/aboutStartup.js
toolkit/mozapps/extensions/AddonManager.jsm
--- a/toolkit/content/aboutStartup.js
+++ b/toolkit/content/aboutStartup.js
@@ -6,18 +6,18 @@ let stringsvc = Components.classes["@moz
 let strings = stringsvc.createBundle("chrome://global/locale/aboutStartup.properties");
 let branding = stringsvc.createBundle("chrome://branding/locale/brand.properties");
 
 function displayTimestamp(id, µs) document.getElementById(id).textContent = formatstamp(µs);
 function displayDuration(id, µs) document.getElementById(id).nextSibling.textContent = formatms(msFromµs(µs));
 
 function formatStr(str, args) strings.formatStringFromName("about.startup."+ str, args, args.length);
 function appVersion(version, build) formatStr("appVersion",
-//                                              [branding.getStringFromName("brandShortName"),
-                                              ["Firefox",
+                                              [branding.getStringFromName("brandShortName"),
+//                                              ["Firefox",
                                                version, build]);
 function formatExtension(str, id, version) formatStr("extension"+str, [id, version]);
 
 function msFromµs(µs) µs / 1000;
 function formatstamp(µs) new Date(msFromµs(µs));
 function formatµs(µs) µs + " µs";
 function formatms(ms) formatStr("milliseconds", [ms]);
 
--- a/toolkit/mozapps/extensions/AddonManager.jsm
+++ b/toolkit/mozapps/extensions/AddonManager.jsm
@@ -825,23 +825,30 @@ var AddonManagerInternal = {
    *         The listener to remove
    */
   removeAddonListener: function AMI_removeAddonListener(aListener) {
     this.addonListeners = this.addonListeners.filter(function(i) {
       return i != aListener;
     });
   },
 
+  /**
+   * Adds an AddonListener that uses the observer service to notify
+   * native code of the extension events.
+   *
+   * Currently only handles that subset of the events and data that
+   * the about:startup page requires.
+   *
+   */
   _addNotificationListeners: function()
   {
     const svc = Cc["@mozilla.org/observer-service;1"]
                   .getService(Ci.nsIObserverService);
     function notify(msg, extension)
     {
-      WARN("notifying observers of extension"+ msg);
       let bag = Cc["@mozilla.org/hash-property-bag;1"]
                   .createInstance(Ci.nsIWritablePropertyBag2);
       bag.setPropertyAsAString("id", extension.id);
       bag.setPropertyAsAString("name", extension.name);
       bag.setPropertyAsAString("version", extension.version);
       svc.notifyObservers(bag, "AddonManager-event", msg);
     }
     this.addAddonListener({ onEnabling: function(extension) { notify("Enabled", extension) },