mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-14 22:05:44 +00:00
Bug 909786 - Use incremental id as the hash key of |controlCallbacks|. r=vchang
This commit is contained in:
parent
ae6790e787
commit
7c969e03c1
@ -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];
|
||||
}
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user