Bug 909786 - Use incremental id as the hash key of |controlCallbacks|. r=vchang

This commit is contained in:
Henry Chang 2013-08-27 23:38:10 +08:00
parent f0b60832c5
commit 249cbee5b4

View File

@ -456,9 +456,10 @@ NetworkManager.prototype = {
// Helpers
idgen: 0,
controlMessage: function controlMessage(params, callback) {
if (callback) {
let id = callback.name;
let id = this.idgen++;
params.id = id;
this.controlCallbacks[id] = callback;
}
@ -476,6 +477,7 @@ NetworkManager.prototype = {
let callback = this.controlCallbacks[id];
if (callback) {
callback.call(this, response);
delete this.controlCallbacks[id];
}
},