зеркало из https://github.com/mozilla/gecko-dev.git
Bug 965305 - Update stats needed before reset. r=gene
This commit is contained in:
Родитель
87e615ef94
Коммит
40d89f6fc9
|
@ -466,10 +466,18 @@ this.NetworkStatsService = {
|
|||
}
|
||||
|
||||
network = {network: network, networkId: aNetId};
|
||||
self._db.clearInterfaceStats(network, function onDBCleared(aError, aResult) {
|
||||
self.updateStats(aNetId, function onUpdate(aResult, aMessage) {
|
||||
if (!aResult) {
|
||||
mm.sendAsyncMessage("NetworkStats:Clear:Return",
|
||||
{ id: msg.id, error: aMessage, result: null });
|
||||
return;
|
||||
}
|
||||
|
||||
self._db.clearInterfaceStats(network, function onDBCleared(aError, aResult) {
|
||||
self._updateCurrentAlarm(aNetId);
|
||||
mm.sendAsyncMessage("NetworkStats:Clear:Return",
|
||||
{ id: msg.id, error: aError, result: aResult });
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
|
@ -488,12 +496,20 @@ this.NetworkStatsService = {
|
|||
networks[index] = {network: network, networkId: self.getNetworkId(network.id, network.type)};
|
||||
}, self);
|
||||
|
||||
self._db.clearStats(networks, function onDBCleared(aError, aResult) {
|
||||
networks.forEach(function(network, index) {
|
||||
self._updateCurrentAlarm(network.networkId);
|
||||
}, self);
|
||||
mm.sendAsyncMessage("NetworkStats:ClearAll:Return",
|
||||
{ id: msg.id, error: aError, result: aResult });
|
||||
self.updateAllStats(function onUpdate(aResult, aMessage){
|
||||
if (!aResult) {
|
||||
mm.sendAsyncMessage("NetworkStats:ClearAll:Return",
|
||||
{ id: msg.id, error: aMessage, result: null });
|
||||
return;
|
||||
}
|
||||
|
||||
self._db.clearStats(networks, function onDBCleared(aError, aResult) {
|
||||
networks.forEach(function(network, index) {
|
||||
self._updateCurrentAlarm(network.networkId);
|
||||
}, self);
|
||||
mm.sendAsyncMessage("NetworkStats:ClearAll:Return",
|
||||
{ id: msg.id, error: aError, result: aResult });
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
|
|
Загрузка…
Ссылка в новой задаче