Closed Bug 940254 Opened 8 years ago Closed 7 years ago

Make "storage" permission in the database not grant "offline-app"

Categories

(Core Graveyard :: DOM: Apps, defect)

All
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla29

People

(Reporter: sicking, Assigned: fabrice)

References

Details

(Keywords: perf, Whiteboard: [c=progress p= s=2014.01.17 u=])

Attachments

(1 file)

Currently we grant "offline-app" permission in nsIPermissionManager for all apps that enumerate "storage" as a permission in the manifest.

This has the downside that we start looking for appcached resources in the appcache database, which slows down pageload.

A simple fix to this would be to simply not grant "offline-app" permission when a manifest enumerates "storage". Instead we could create a separate manifest permission specifically for appcache.

That way any apps that doesn't use appcache, including all our gaia apps, can simply avoid asking for the appcache permission.
Mike, can you make sure that this performance bug gets some attention. It should be as simple as modifying the permission in [1] to not grant "offline-app" for the "storage" permission, and instead create a separate permission.

However we also need to coordinate with the marketplace team to make sure that any app which uses appcache also uses the new permission.

Oh, and we need to remove the "offline-app" permission from any already-installed apps as appropriate. That's probably trickier.

[1] http://mxr.mozilla.org/mozilla-central/source/dom/apps/src/PermissionsTable.jsm
We really need to check what marketplace apps are currently using the storage permission to identify any compatibility fallout before moving forward here.
Depends on: 940682
Keywords: perf
Whiteboard: [c=progress p= s= u=]
From the dump in bug 940682 we can see that 268 application declare the "storage" permission. Among these, only 27 also have an appcache_path declared in their manifest.

Jonas, what about doing what you say in comment #0 and automatically grand the offline-cache (and pin-app) permission to apps that declare an appcache in their manifest?
That sounds like a great idea!
Assignee: nobody → fabrice
Attachment #8356881 - Flags: review?(anygregor)
Attachment #8356881 - Flags: review?(anygregor) → review+
Pushed to try with a couple of tests fixed:
https://tbpl.mozilla.org/?tree=Try&rev=f72b8ec86141
https://hg.mozilla.org/mozilla-central/rev/aed7f997fb00
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla29
Whiteboard: [c=progress p= s= u=] → [c=progress p= s=2014.01.17 u=]
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.