mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1051513 - Fix update of webapp activity registration. r=fabrice
Remove all old activities for a given manifest before re-registering new ones.
This commit is contained in:
parent
63a5782589
commit
bf797a46b8
@ -122,6 +122,20 @@ ActivitiesDb.prototype = {
|
||||
}.bind(this), function() {}, function() {});
|
||||
},
|
||||
|
||||
// Remove all activities associated with the given |aManifest| URL.
|
||||
removeAll: function actdb_removeAll(aManifest) {
|
||||
this.newTxn("readwrite", STORE_NAME, function (txn, store) {
|
||||
let index = store.index("manifest");
|
||||
let request = index.mozGetAll(aManifest);
|
||||
request.onsuccess = function manifestActivities(aEvent) {
|
||||
aEvent.target.result.forEach(function(result) {
|
||||
debug('Removing activity: ' + JSON.stringify(result));
|
||||
store.delete(result.id);
|
||||
});
|
||||
};
|
||||
});
|
||||
},
|
||||
|
||||
find: function actdb_find(aObject, aSuccess, aError, aMatch) {
|
||||
debug("Looking for " + aObject.options.name);
|
||||
|
||||
@ -166,6 +180,7 @@ let Activities = {
|
||||
|
||||
"Activities:Register",
|
||||
"Activities:Unregister",
|
||||
"Activities:UnregisterAll",
|
||||
"Activities:GetContentTypes",
|
||||
|
||||
"child-process-shutdown"
|
||||
@ -394,6 +409,9 @@ let Activities = {
|
||||
case "Activities:Unregister":
|
||||
this.db.remove(msg);
|
||||
break;
|
||||
case "Activities:UnregisterAll":
|
||||
this.db.removeAll(msg);
|
||||
break;
|
||||
case "child-process-shutdown":
|
||||
for (let id in this.callers) {
|
||||
if (this.callers[id].childMM == mm) {
|
||||
|
@ -883,6 +883,10 @@ this.DOMApplicationRegistry = {
|
||||
activitiesToRegister.push.apply(activitiesToRegister,
|
||||
this._createActivitiesToRegister(manifest, app, null, aRunUpdate));
|
||||
|
||||
if (aRunUpdate) {
|
||||
cpmm.sendAsyncMessage("Activities:UnregisterAll", app.manifestURL);
|
||||
}
|
||||
|
||||
if (!manifest.entry_points) {
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user