Closed Bug 787299 Opened 12 years ago Closed 12 years ago

Device Storage - Filter out mimetypes during calculation of disk usages

Categories

(Core :: DOM: Device Interfaces, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Tracking Status
firefox18 --- fixed

People

(Reporter: dougt, Assigned: dougt)

Details

Attachments

(1 file)

Currently we ignore file mime type when calculating disk usage.  This means, on gaia, you can not tell how much "pictures" verses "videos" is taking up (since all types are backed by one file system).

What we should do is have DirectoryDiskUsage() take a type and filter based on that.
Assignee: nobody → doug.turner
Attached patch patch v.1Splinter Review
Attachment #658522 - Flags: review?(bent.mozilla)
Comment on attachment 658522 [details] [diff] [review]
patch v.1

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

::: dom/devicestorage/nsDeviceStorage.cpp
@@ -151,2 @@
>  {
> -  NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");

Hm, why remove this? Can the string bundle service really be used on a non-main thread?
> Hm, why remove this?

I enumerate the file system on a non-main thread and need to call isType().  There are probably other ways to do it.

> Can the string bundle service really be used on a non-main thread?

Looks like it.  quickly scanning the implementation, it has locks in the places you'd expect.
Comment on attachment 658522 [details] [diff] [review]
patch v.1

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

We agreed on irc to rework this in a followup to do string bundle stuff on main thread only. r+ on this for now.
Attachment #658522 - Flags: review?(bent.mozilla) → review+
followup bug 788612
https://hg.mozilla.org/mozilla-central/rev/108c96a5c2c0
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Backed out for orange

https://hg.mozilla.org/mozilla-central/rev/fd4d9c386f97
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
https://hg.mozilla.org/mozilla-central/rev/6996c091767d
Status: REOPENED → RESOLVED
Closed: 12 years ago12 years ago
Resolution: --- → FIXED
Push backed out for introducing new M2 orange in test_diskSpace.html & backout of the cset that landed it having conflicts. 

Also, please do not push to mozilla-central unless you are going to watch/star your push (sheriffs are going to be getting more strict about tree rule violations; ie backout).

https://hg.mozilla.org/mozilla-central/rev/5faccd0b7618
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
https://hg.mozilla.org/mozilla-central/rev/089c534af34e
Status: REOPENED → RESOLVED
Closed: 12 years ago12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: