mozilla-b2g/gaia-email-libs-and-more — pull request #302 by jrburke (2014-04-15 22:58:25+00:00)
Title: Bug 796474 - [email] quasi-infinite scroll may hitch under OMTC

The back end changes for the gaia changes related to bug 796474:

FolderStorage now has a headerCount property that is generated initially by summing the counts on the headerBlockInfos. That headerCount is propagated to relevant slices. By exposing the headerCount on slices, this allow the UI to know how big to size a div for virtual scrolling in that folder.

The other notable change is to FolderStorage.flushExcessCachedBlocks: it more aggressively purges bodyBlockInfos to keep memory down, but always keeps the last bodyBlockInfo around as it may be needed by the most recent data operations.

FolderStorage._loadBlock now calls flushExcessCachedBlocks on a longer timeout (5 seconds) to allow cleaning up bodyBlockInfos over time, when there is no slice growing or shrinking.

That change should in general reduce memory usage, particularly if the UI's next/previous navigation is used heavily, and helps counteract the extra size used by the UI for all the headers as it no longer tries to shrink the slice for better scroll behavior.