Bug 755771 - Part 2: Send purge count to Java. r=mfinkle

This commit is contained in:
Brian Nicholson 2012-05-16 23:07:55 -07:00
parent 5799c814ae
commit dcd4566ae8
2 changed files with 9 additions and 3 deletions

View File

@ -455,8 +455,14 @@ public final class Tab {
}
mHistoryIndex = index;
} else if (event.equals("Purge")) {
mHistorySize = 0;
mHistoryIndex = -1;
int numEntries = message.getInt("index");
mHistorySize -= numEntries;
mHistoryIndex -= numEntries;
if (mHistorySize < 0 || mHistoryIndex < -1) {
Log.e(LOGTAG, "Unexpected history state: index = " + mHistoryIndex + ", size = " + mHistorySize);
mHistorySize = 0;
mHistoryIndex = -1;
}
}
}

View File

@ -2340,7 +2340,7 @@ Tab.prototype = {
},
OnHistoryPurge: function(aNumEntries) {
this._sendHistoryEvent("Purge", -1, null);
this._sendHistoryEvent("Purge", aNumEntries, null);
return true;
},