Backed out changeset 4a271b44cbfe (bug 810146). r=bustageahoy
authorRyan VanderMeulen <ryanvm@gmail.com>
Mon, 28 Jan 2013 15:14:28 -0500
changeset 120102 0c45e6378f1f07a1e207a3f10be403c774cee850
parent 120101 3f53e846312b0d1d3e1c59cd82755305a7a60686
child 120103 0c84939daa2868c351a9e0aba274245af5ed7411
child 120221 9f22692e440433ca23980d28669826bde51436f5
child 127225 420954df93b8321b42ad776b692d642ebd23c90e
push id22037
push userryanvm@gmail.com
push dateMon, 28 Jan 2013 20:15:38 +0000
treeherdermozilla-inbound@0c45e6378f1f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbustageahoy
bugs810146
milestone21.0a1
backs out4a271b44cbfe87c3422b014dbc3f94a3e2ea2414
first release with
nightly linux32
0c45e6378f1f / 21.0a1 / 20130129030851 / files
nightly linux64
0c45e6378f1f / 21.0a1 / 20130129030851 / files
nightly mac
0c45e6378f1f / 21.0a1 / 20130129030851 / files
nightly win32
0c45e6378f1f / 21.0a1 / 20130129030851 / files
nightly win64
0c45e6378f1f / 21.0a1 / 20130129030851 / 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
Backed out changeset 4a271b44cbfe (bug 810146). r=bustageahoy CLOSED TREE
toolkit/components/telemetry/TelemetryPing.js
toolkit/content/aboutTelemetry.js
toolkit/mozapps/extensions/AddonManager.jsm
toolkit/mozapps/extensions/XPIProvider.jsm
--- a/toolkit/components/telemetry/TelemetryPing.js
+++ b/toolkit/components/telemetry/TelemetryPing.js
@@ -116,21 +116,16 @@ function getSimpleMeasurements() {
 
   // Look for app-specific timestamps
   var appTimestamps = {};
   try {
     let o = {};
     Cu.import("resource:///modules/TelemetryTimestamps.jsm", o);
     appTimestamps = o.TelemetryTimestamps.get();
   } catch (ex) {}
-  try {
-    let o = {};
-    Cu.import("resource://gre/modules/AddonManager.jsm", o);
-    ret.addonManager = o.AddonManagerPrivate.getSimpleMeasures();
-  } catch (ex) {}
 
   if (si.process) {
     for each (let field in Object.keys(si)) {
       if (field == "process")
         continue;
       ret[field] = si[field] - si.process
     }
 
--- a/toolkit/content/aboutTelemetry.js
+++ b/toolkit/content/aboutTelemetry.js
@@ -759,19 +759,17 @@ let LateWritesSingleton = {
  * @return Sorted measurements
  */
 function sortStartupMilestones(aSimpleMeasurements) {
   // List of startup milestones
   const startupMilestones =
     ["start", "main", "startupCrashDetectionBegin", "createTopLevelWindow",
      "firstPaint", "delayedStartupStarted", "firstLoadURI",
      "sessionRestoreInitialized", "sessionRestoreRestoring", "sessionRestored",
-     "delayedStartupFinished", "startupCrashDetectionEnd",
-     "AMI_startup_begin", "AMI_startup_end", "XPI_startup_begin", "XPI_startup_end",
-     "XPI_bootstrap_addons_begin", "XPI_bootstrap_addons_end"];
+     "delayedStartupFinished", "startupCrashDetectionEnd"];
 
   let sortedKeys = Object.keys(aSimpleMeasurements);
 
   // Sort the measurements, with startup milestones at the front + ordered by time
   sortedKeys.sort(function keyCompare(keyA, keyB) {
     let isKeyAMilestone = (startupMilestones.indexOf(keyA) > -1);
     let isKeyBMilestone = (startupMilestones.indexOf(keyB) > -1);
 
--- a/toolkit/mozapps/extensions/AddonManager.jsm
+++ b/toolkit/mozapps/extensions/AddonManager.jsm
@@ -2,17 +2,16 @@
  * 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/. */
 
 "use strict";
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cr = Components.results;
-const Cu = Components.utils;
 
 const PREF_BLOCKLIST_PINGCOUNTVERSION = "extensions.blocklist.pingCountVersion";
 const PREF_EM_UPDATE_ENABLED          = "extensions.update.enabled";
 const PREF_EM_LAST_APP_VERSION        = "extensions.lastAppVersion";
 const PREF_EM_LAST_PLATFORM_VERSION   = "extensions.lastPlatformVersion";
 const PREF_EM_AUTOUPDATE_DEFAULT      = "extensions.update.autoUpdateDefault";
 const PREF_EM_STRICT_COMPATIBILITY    = "extensions.strictCompatibility";
 const PREF_EM_CHECK_UPDATE_SECURITY   = "extensions.checkUpdateSecurity";
@@ -432,30 +431,24 @@ var AddonManagerInternal = {
     // Despite MDC's claims to the contrary, it is required that this trap
     // be defined
     enumerate: function typesProxy_enumerate() {
       // All properties are enumerable
       return this.getPropertyNames();
     }
   }),
 
-  recordTimestamp: function AMI_recordTimestamp(name, value) {
-    this.TelemetryTimestamps.add(name, value);
-  },
-
   /**
    * Initializes the AddonManager, loading any known providers and initializing
    * them.
    */
   startup: function AMI_startup() {
     if (gStarted)
       return;
 
-    this.recordTimestamp("AMI_startup_begin");
-
     Services.obs.addObserver(this, "xpcom-shutdown", false);
 
     let appChanged = undefined;
 
     let oldAppVersion = null;
     try {
       oldAppVersion = Services.prefs.getCharPref(PREF_EM_LAST_APP_VERSION);
       appChanged = Services.appinfo.version != oldAppVersion;
@@ -553,17 +546,16 @@ var AddonManagerInternal = {
 
     // If this is a new profile just pretend that there were no changes
     if (appChanged === undefined) {
       for (let type in this.startupChanges)
         delete this.startupChanges[type];
     }
 
     gStartupComplete = true;
-    this.recordTimestamp("AMI_startup_end");
   },
 
   /**
    * Registers a new AddonProvider.
    *
    * @param  aProvider
    *         The provider to register
    * @param  aTypes
@@ -2082,30 +2074,17 @@ this.AddonManagerPrivate = {
   },
 
   AddonAuthor: AddonAuthor,
 
   AddonScreenshot: AddonScreenshot,
 
   AddonCompatibilityOverride: AddonCompatibilityOverride,
 
-  AddonType: AddonType,
-
-  recordTimestamp: function AMP_recordTimestamp(name, value) {
-    AddonManagerInternal.recordTimestamp(name, value);
-  },
-
-  _simpleMeasures: {},
-  recordSimpleMeasure: function AMP_recordSimpleMeasure(name, value) {
-    this._simpleMeasures[name] = value;
-  },
-
-  getSimpleMeasures: function AMP_getSimpleMeasures() {
-    return this._simpleMeasures;
-  }
+  AddonType: AddonType
 };
 
 /**
  * This is the public API that UI and developers should be calling. All methods
  * just forward to AddonManagerInternal.
  */
 this.AddonManager = {
   // Constants for the AddonInstall.state property
@@ -2442,13 +2421,11 @@ this.AddonManager = {
     return AddonManagerInternal.hotfixID;
   },
 
   escapeAddonURI: function AM_escapeAddonURI(aAddon, aUri, aAppVersion) {
     return AddonManagerInternal.escapeAddonURI(aAddon, aUri, aAppVersion);
   }
 };
 
-// load the timestamps module into AddonManagerInternal
-Cu.import("resource:///modules/TelemetryTimestamps.jsm", AddonManagerInternal);
 Object.freeze(AddonManagerInternal);
 Object.freeze(AddonManagerPrivate);
 Object.freeze(AddonManager);
--- a/toolkit/mozapps/extensions/XPIProvider.jsm
+++ b/toolkit/mozapps/extensions/XPIProvider.jsm
@@ -1498,18 +1498,16 @@ var XPIProvider = {
 
   // True if all of the add-ons found during startup were installed in the
   // application install location
   allAppGlobal: true,
   // A string listing the enabled add-ons for annotating crash reports
   enabledAddons: null,
   // An array of add-on IDs of add-ons that were inactive during startup
   inactiveAddonIDs: [],
-  // Count of unpacked add-ons
-  unpackedAddons: 0,
 
   /**
    * Starts the XPI provider initializes the install locations and prefs.
    *
    * @param  aAppChanged
    *         A tri-state value. Undefined means the current profile was created
    *         for this session, true means the profile already existed but was
    *         last used with an application with a different version number,
@@ -1523,18 +1521,16 @@ var XPIProvider = {
    *         if it is a new profile or the version is unknown
    */
   startup: function XPI_startup(aAppChanged, aOldAppVersion, aOldPlatformVersion) {
     LOG("startup");
     this.installs = [];
     this.installLocations = [];
     this.installLocationsByName = {};
 
-    AddonManagerPrivate.recordTimestamp("XPI_startup_begin");
-
     function addDirectoryInstallLocation(aName, aKey, aPaths, aScope, aLocked) {
       try {
         var dir = FileUtils.getDir(aKey, aPaths);
       }
       catch (e) {
         // Some directories aren't defined on some platforms, ignore them
         LOG("Skipping unavailable install location " + aName);
         return;
@@ -1662,25 +1658,23 @@ var XPIProvider = {
       } catch (e) { }
       try {
         Services.appinfo.annotateCrashReport("EMCheckCompatibility",
                                              AddonManager.checkCompatibility);
       } catch (e) { }
       this.addAddonsToCrashReporter();
     }
 
-    AddonManagerPrivate.recordTimestamp("XPI_bootstrap_addons_begin");
     for (let id in this.bootstrappedAddons) {
       let file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile);
       file.persistentDescriptor = this.bootstrappedAddons[id].descriptor;
       this.callBootstrapMethod(id, this.bootstrappedAddons[id].version,
                                this.bootstrappedAddons[id].type, file,
                                "startup", BOOTSTRAP_REASONS.APP_STARTUP);
     }
-    AddonManagerPrivate.recordTimestamp("XPI_bootstrap_addons_end");
 
     // Let these shutdown a little earlier when they still have access to most
     // of XPCOM
     Services.obs.addObserver({
       observe: function shutdownObserver(aSubject, aTopic, aData) {
         Services.prefs.setCharPref(PREF_BOOTSTRAP_ADDONS,
                                    JSON.stringify(XPIProvider.bootstrappedAddons));
         for (let id in XPIProvider.bootstrappedAddons) {
@@ -1689,18 +1683,16 @@ var XPIProvider = {
           XPIProvider.callBootstrapMethod(id, XPIProvider.bootstrappedAddons[id].version,
                                           XPIProvider.bootstrappedAddons[id].type, file, "shutdown",
                                           BOOTSTRAP_REASONS.APP_SHUTDOWN);
         }
         Services.obs.removeObserver(this, "quit-application-granted");
       }
     }, "quit-application-granted", false);
 
-    AddonManagerPrivate.recordTimestamp("XPI_startup_end");
-
     this.extensionsActive = true;
   },
 
   /**
    * Shuts down the database and releases all references.
    */
   shutdown: function XPI_shutdown() {
     LOG("shutdown");
@@ -1831,41 +1823,32 @@ var XPIProvider = {
   getAddonStates: function XPI_getAddonStates(aLocation) {
     let addonStates = {};
     aLocation.addonLocations.forEach(function(file) {
       let id = aLocation.getIDForLocation(file);
       addonStates[id] = {
         descriptor: file.persistentDescriptor,
         mtime: recursiveLastModifiedTime(file)
       };
-      try {
-        // get the install.rdf update time, if any
-        file.append(FILE_INSTALL_MANIFEST);
-        let rdfTime = file.lastModifiedTime;
-        addonStates[id].rdfTime = rdfTime;
-        this.unpackedAddons += 1;
-      }
-      catch (e) { }
-    }, this);
+    });
 
     return addonStates;
   },
 
   /**
    * Gets an array of install location states which uniquely describes all
    * installed add-ons with the add-on's InstallLocation name and last modified
    * time. This function may be expensive because of the getAddonStates() call.
    *
    * @return an array of add-on states for each install location. Each state
    *         is an object with a name property holding the location's name and
    *         an addons property holding the add-on states for the location
    */
   getInstallLocationStates: function XPI_getInstallLocationStates() {
     let states = [];
-    this.unpackedAddons = 0;
     this.installLocations.forEach(function(aLocation) {
       let addons = aLocation.addonLocations;
       if (addons.length == 0)
         return;
 
       let locationState = {
         name: aLocation.name,
         addons: this.getAddonStates(aLocation)
@@ -2820,21 +2803,16 @@ var XPIProvider = {
       }
 
       return false;
     }
 
     let changed = false;
     let knownLocations = XPIDatabase.getInstallLocations();
 
-    // Gather stats for addon telemetry
-    let modifiedUnpacked = 0;
-    let modifiedExManifest = 0;
-    let modifiedXPI = 0;
-
     // The install locations are iterated in reverse order of priority so when
     // there are multiple add-ons installed with the same ID the one that
     // should be visible is the first one encountered.
     aState.reverse().forEach(function(aSt) {
 
       // We can't include the install location directly in the state as it has
       // to be cached as JSON.
       let installLocation = this.installLocationsByName[aSt.name];
@@ -2860,27 +2838,16 @@ var XPIProvider = {
           if (aOldAddon.id in addonStates) {
             let addonState = addonStates[aOldAddon.id];
             delete addonStates[aOldAddon.id];
 
             // Remember add-ons that were inactive during startup
             if (aOldAddon.visible && !aOldAddon.active)
               XPIProvider.inactiveAddonIDs.push(aOldAddon.id);
 
-            // Check if the add-on is unpacked, and has had other files changed
-            // on disk without the install.rdf manifest being changed
-            if ((addonState.rdfTime) && (aOldAddon.updateDate != addonState.mtime)) {
-              modifiedUnpacked += 1;
-              if (aOldAddon.updateDate >= addonState.rdfTime)
-                modifiedExManifest += 1;
-            }
-            else if (aOldAddon.updateDate != addonState.mtime) {
-              modifiedXPI += 1;
-            }
-
             // The add-on has changed if the modification time has changed, or
             // we have an updated manifest for it. Also reload the metadata for
             // add-ons in the application directory when the application version
             // has changed
             if (aOldAddon.id in aManifests[installLocation.name] ||
                 aOldAddon.updateDate != addonState.mtime ||
                 (aUpdateCompatibility && installLocation.name == KEY_APP_GLOBAL)) {
               changed = updateMetadata(installLocation, aOldAddon, addonState) ||
@@ -2922,22 +2889,16 @@ var XPIProvider = {
     // database.
     knownLocations.forEach(function(aLocation) {
       let addons = XPIDatabase.getAddonsInLocation(aLocation);
       addons.forEach(function(aOldAddon) {
         changed = removeMetadata(aLocation, aOldAddon) || changed;
       }, this);
     }, this);
 
-    // Tell Telemetry what we found
-    AddonManagerPrivate.recordSimpleMeasure("modifiedUnpacked", modifiedUnpacked);
-    if (modifiedUnpacked > 0)
-      AddonManagerPrivate.recordSimpleMeasure("modifiedExceptInstallRDF", modifiedExManifest);
-    AddonManagerPrivate.recordSimpleMeasure("modifiedXPI", modifiedXPI);
-
     // Cache the new install location states
     let cache = JSON.stringify(this.getInstallLocationStates());
     Services.prefs.setCharPref(PREF_INSTALL_CACHE, cache);
 
     // Clear out any cached migration data.
     XPIDatabase.migrateData = null;
 
     return changed;
@@ -3083,17 +3044,16 @@ var XPIProvider = {
                                                          aAppChanged,
                                                          aOldAppVersion,
                                                          aOldPlatformVersion);
         }
         catch (e) {
           ERROR("Error processing file changes", e);
         }
       }
-      AddonManagerPrivate.recordSimpleMeasure("installedUnpacked", this.unpackedAddons);
 
       if (aAppChanged) {
         // When upgrading the app and using a custom skin make sure it is still
         // compatible otherwise switch back the default
         if (this.currentSkin != this.defaultSkin) {
           if (!transationBegun) {
             XPIDatabase.beginTransaction();
             transationBegun = true;