Open Bug 1367216 Opened 8 years ago Updated 2 years ago

Refactor Cache API mozilla::dom::cache::Connection class (dom/cache/Connection.cpp) so consumers can instead use mozStorage connections and its built-in incremental vacuum support

Categories

(Core :: Storage: Cache API, enhancement, P3)

enhancement

Tracking

()

People

(Reporter: asuth, Unassigned)

References

Details

Bug 1217544 is extracting some mozStorage-related functionality out of dom/cache so dom/backgroundsync could use it. (Namely mozStorageConnectionUtils.{h,cpp} and IncrementalVacuumConnect.{h,cpp}. Discussion starts at https://bugzilla.mozilla.org/show_bug.cgi?id=1217544#c129.) One conclusion was that IncrementalVacuumConnection (which exists only to provide automatic incremental vacuuming on close) really doesn't need to exist as a decorator and its logic can be integrated into our mozIStorageConnection implementation directly. Care should be taken to emphasize in comments and documentation that incremental vacuum is about minimizing disk usage of a file, not about reducing on-disk fragmentation or btree fragmentation. (mozStorageConnectionUtils' IncrementalVacuum method has some good comments to this effect about how aMaxFreePages is used to create hysteresis so that we avoid creating pathological on-disk fragmentation.)
Priority: -- → P3
Severity: normal → S3

Bug 1813986 has added a RemovablePagesInFreeList() method and some vacuum code that could be reused.

We ended up abandoning the implementation referenced in comment 0, but the DOM Cache API Connection class continues to exist only for incremental-vacuum-on-close, and could benefit from the great changes in bug 1813986, so I've amended the subject and component of this bug. Thank you!

Component: Storage → Storage: Cache API
Depends on: 1813986
No longer depends on: 1217544
Product: Toolkit → Core
Summary: Refactor IncrementalVacuumConnection's incremental-vacuum-on-close behavior into mozIStorageConnection → Refactor Cache API mozilla::dom::cache::Connection class (dom/cache/Connection.cpp) so consumers can instead use mozStorage connections and its built-in incremental vacuum support
You need to log in before you can comment on or make changes to this bug.