Bug 917012 - Too many mainthread stat() calls during downloads. r=enn

This commit is contained in:
Paolo Amadini 2013-10-08 20:28:35 +02:00
parent d6a0e0f54c
commit 13e81160d0

View File

@ -757,6 +757,7 @@ DownloadsDataCtor.prototype = {
*/
_updateDataItemState: function (aDataItem)
{
let oldState = aDataItem.state;
let wasInProgress = aDataItem.inProgress;
let wasDone = aDataItem.done;
@ -766,11 +767,13 @@ DownloadsDataCtor.prototype = {
aDataItem.endTime = Date.now();
}
for (let view of this._views) {
try {
view.getViewItem(aDataItem).onStateChange({});
} catch (ex) {
Cu.reportError(ex);
if (oldState != aDataItem.state) {
for (let view of this._views) {
try {
view.getViewItem(aDataItem).onStateChange(oldState);
} catch (ex) {
Cu.reportError(ex);
}
}
}