Bug 1191579 - Remove useless getAll() implementation in Webapps.jsm

This commit is contained in:
Fabrice Desré 2015-08-06 07:43:59 -07:00
parent 6daec6b0a8
commit a3cecb5ae0
2 changed files with 10 additions and 25 deletions

View File

@ -738,7 +738,11 @@ this.DOMApplicationRegistry = {
loadAndUpdateApps: function() {
return Task.spawn(function*() {
let runUpdate = AppsUtils.isFirstRun(Services.prefs);
let runUpdate = false;
try {
runUpdate = AppsUtils.isFirstRun(Services.prefs);
} catch(e) {}
let loadAppPermission = Services.prefs.getBoolPref("dom.apps.reset-permissions");
yield this.loadCurrentRegistry();
@ -801,7 +805,7 @@ this.DOMApplicationRegistry = {
// installPreinstalledApp() removes the ones failing to install.
this._saveApps();
Services.prefs.setBoolPref("dom.apps.reset-permissions", true);
Services.prefs.setBoolPref("dom.apps.reset-permissions", true);
}
// DataStores must be initialized at startup.
@ -4335,27 +4339,6 @@ this.DOMApplicationRegistry = {
});
},
getAll: function(aCallback) {
debug("getAll");
let apps = [];
let tmp = [];
for (let id in this.webapps) {
let app = AppsUtils.cloneAppObject(this.webapps[id]);
if (!this._isLaunchable(app))
continue;
apps.push(app);
tmp.push({ id: id });
}
this._readManifests(tmp).then((aResult) => {
for (let i = 0; i < aResult.length; i++)
apps[i].manifest = aResult[i].manifest;
aCallback(apps);
});
},
/* Check if |data| is actually a receipt */
isReceipt: function(data) {
try {

View File

@ -214,6 +214,9 @@ function WebappsActor(aConnection) {
Cu.import("resource://gre/modules/FileUtils.jsm");
Cu.import("resource://gre/modules/MessageBroadcaster.jsm");
this.appsChild = {};
Cu.import("resource://gre/modules/AppsServiceChild.jsm", this.appsChild);
// Keep reference of already connected app processes.
// values: app frame message manager
this._connectedApps = new Set();
@ -688,8 +691,7 @@ WebappsActor.prototype = {
debug("getAll");
let deferred = promise.defer();
let reg = DOMApplicationRegistry;
reg.getAll(apps => {
this.appsChild.DOMApplicationRegistry.getAll(apps => {
deferred.resolve({ apps: this._filterAllowedApps(apps) });
});