Closed Bug 878493 Opened 11 years ago Closed 11 years ago

DeviceStorage: Invalidate used space cache if free space changes

Categories

(Core :: DOM: Device Interfaces, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla24
blocking-b2g leo+
Tracking Status
firefox22 --- wontfix
firefox23 --- wontfix
firefox24 --- fixed
b2g18 --- fixed
b2g18-v1.0.0 --- wontfix
b2g18-v1.0.1 --- wontfix
b2g-v1.1hd --- fixed

People

(Reporter: dhylands, Assigned: dhylands)

References

Details

(Whiteboard: [fixed-in-birch][mozilla-triage])

Attachments

(1 file, 1 obsolete file)

A used space cache was added to reduce the time it takes to calculate the amount of space used by the various file types.

However, if files are added/removed from the filesystem without going through device storage, then it won't know to invalidate the used space cache.

One fairly simple, and efficient way to cover this case is to invalidate the cache if the amount of free space changes (this implies that the used space also changed somehow).
This patch caused the used space cache retrieval to fail if the used space changes.
I also noticed that the GetUsedSizeForType function was no longer referenced anywhere, so I removed it.
Attachment #757183 - Attachment is obsolete: true
Comment on attachment 757366 [details] [diff] [review]
invalidate used space cache if the free space changes. v2

Review of attachment 757366 [details] [diff] [review]:
-----------------------------------------------------------------

I thought I'd send this your way. If you're too busy or don't feel comfortable reviewing, please let me know and I'll find somebody else.
Attachment #757366 - Flags: review?(Jan.Varga)
Comment on attachment 757366 [details] [diff] [review]
invalidate used space cache if the free space changes. v2

Review of attachment 757366 [details] [diff] [review]:
-----------------------------------------------------------------

looks good
Attachment #757366 - Flags: review?(Jan.Varga) → review+
https://hg.mozilla.org/mozilla-central/rev/b39f3b7995aa
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
https://bugzilla.mozilla.org/show_bug.cgi?id=876560#c7
Whiteboard: [fixed-in-birch] → [fixed-in-birch][mozilla-triage]
blocking-b2g: leo? → leo+
Flags: in-moztrap-
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: