Skip to content

Commit

Permalink
Remove FHR from app update Bug 1121018 - FHR data migration: org.mozi…
Browse files Browse the repository at this point in the history
…lla.update. r=spohl
  • Loading branch information
Robert Strong committed Mar 29, 2015
1 parent 24b4f38 commit bb8cdf7
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 228 deletions.
69 changes: 0 additions & 69 deletions toolkit/mozapps/update/UpdaterHealthProvider.jsm

This file was deleted.

4 changes: 0 additions & 4 deletions toolkit/mozapps/update/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,4 @@ if CONFIG['MOZ_UPDATER']:
'nsUpdateService.js',
]

EXTRA_JS_MODULES += [
'UpdaterHealthProvider.jsm'
]

JAR_MANIFESTS += ['jar.mn']
65 changes: 0 additions & 65 deletions toolkit/mozapps/update/nsUpdateService.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ Components.utils.import("resource://gre/modules/FileUtils.jsm");
Components.utils.import("resource://gre/modules/AddonManager.jsm");
Components.utils.import("resource://gre/modules/Services.jsm");
Components.utils.import("resource://gre/modules/ctypes.jsm");
#ifdef MOZ_SERVICES_HEALTHREPORT
Components.utils.import("resource://gre/modules/UpdaterHealthProvider.jsm");
#endif

const Cc = Components.classes;
const Ci = Components.interfaces;
Expand Down Expand Up @@ -261,18 +258,6 @@ const PING_BGUC_ADDON_UPDATES_FOR_INCOMPAT = 29;
// Incompatible add-ons found (update notification)
const PING_BGUC_ADDON_HAVE_INCOMPAT = 30;

// Health report field names
const UpdaterHealthReportFields = {
CHECK_START: "updateCheckStart",
CHECK_SUCCESS: "updateCheckSuccess",
CHECK_FAILED: "updateCheckFailed",
COMPLETE_START: "completeUpdateStart",
PARTIAL_START: "partialUpdateStart",
COMPLETE_SUCCESS: "completeUpdateSuccess",
PARTIAL_SUCCESS: "partialUpdateSuccess",
FAILED: "updateFailed"
};

var gLocale = null;
var gUpdateMutexHandle = null;

Expand Down Expand Up @@ -964,37 +949,6 @@ function getStatusTextFromCode(code, defaultCode) {
return reason;
}

/**
* Record count in the health report.
* @param field
* The field name to record
* @param status
* Status code for errors, 0 otherwise
*/
function recordInHealthReport(field, status) {
#ifdef MOZ_SERVICES_HEALTHREPORT
try {
LOG("recordInHealthReport - " + field + " - " + status);

let reporter = Cc["@mozilla.org/datareporting/service;1"]
.getService().wrappedJSObject.healthReporter;

if (reporter) {
reporter.onInit().then(function recordUpdateInHealthReport() {
try {
reporter.getProvider("org.mozilla.update").recordUpdate(field, status);
} catch (ex) {
Cu.reportError(ex);
}
});
}
// If getting the heath reporter service fails, don't fail updating.
} catch (ex) {
LOG("recordInHealthReport - could not initialize health reporter");
}
#endif
}

/**
* Get the Active Updates directory
* @return The active updates directory, as a nsIFile object
Expand Down Expand Up @@ -3721,8 +3675,6 @@ Checker.prototype = {
if (!url || (!this.enabled && !force))
return;

recordInHealthReport(UpdaterHealthReportFields.CHECK_START, 0);

this._request = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"].
createInstance(Ci.nsISupports);
// This is here to let unit test code override XHR
Expand Down Expand Up @@ -3846,8 +3798,6 @@ Checker.prototype = {
if (Services.prefs.prefHasUserValue(PREF_APP_UPDATE_BACKGROUNDERRORS))
Services.prefs.clearUserPref(PREF_APP_UPDATE_BACKGROUNDERRORS);

recordInHealthReport(UpdaterHealthReportFields.CHECK_SUCCESS, 0);

// Tell the callback about the updates
this._callback.onCheckComplete(event.target, updates, updates.length);
}
Expand All @@ -3869,8 +3819,6 @@ Checker.prototype = {
: CERT_ATTR_CHECK_FAILED_NO_UPDATE;
}

recordInHealthReport(UpdaterHealthReportFields.CHECK_FAILED, update.errorCode);

this._callback.onError(request, update);
}

Expand Down Expand Up @@ -3902,10 +3850,7 @@ Checker.prototype = {
update.errorCode = HTTP_ERROR_OFFSET + status;
}

recordInHealthReport(UpdaterHealthReportFields.CHECK_FAILED, update.errorCode);

this._callback.onError(request, update);

this._request = null;
},

Expand Down Expand Up @@ -4221,10 +4166,6 @@ Downloader.prototype = {
}
this.isCompleteUpdate = this._patch.type == "complete";

recordInHealthReport(
this.isCompleteUpdate ? UpdaterHealthReportFields.COMPLETE_START :
UpdaterHealthReportFields.PARTIAL_START, 0);

var patchFile = null;

#ifdef MOZ_WIDGET_GONK
Expand Down Expand Up @@ -4480,10 +4421,6 @@ Downloader.prototype = {
"current fail: " + this.updateService._consecutiveSocketErrors + ", " +
"max fail: " + maxFail + ", " + "retryTimeout: " + retryTimeout);
if (Components.isSuccessCode(status)) {
recordInHealthReport(
this.isCompleteUpdate ? UpdaterHealthReportFields.COMPLETE_SUCCESS :
UpdaterHealthReportFields.PARTIAL_SUCCESS, 0);

if (this._verifyDownload()) {
state = shouldUseService() ? STATE_PENDING_SVC : STATE_PENDING;
if (this.background) {
Expand Down Expand Up @@ -4513,8 +4450,6 @@ Downloader.prototype = {
cleanUpUpdatesDir();
}
} else {
recordInHealthReport(UpdaterHealthReportFields.FAILED, status);

if (status == Cr.NS_ERROR_OFFLINE) {
// Register an online observer to try again.
// The online observer will continue the incremental download by
Expand Down
88 changes: 0 additions & 88 deletions toolkit/mozapps/update/tests/unit_aus_update/updateHealthReport.js

This file was deleted.

2 changes: 0 additions & 2 deletions toolkit/mozapps/update/tests/unit_aus_update/xpcshell.ini
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,3 @@ reason = custom nsIUpdatePrompt
[uiUnsupportedAlreadyNotified.js]
skip-if = toolkit == 'gonk'
reason = custom nsIUpdatePrompt
[updateHealthReport.js]
skip-if = ! healthreport

0 comments on commit bb8cdf7

Please sign in to comment.