We'd like to be able to read permissions off the main thread using PrincipalInfo. This will require some locking for main-thread writes (which should be rare) and some locking for off-main-thread reads but our common case main-thread reads should be unaffected.
Created attachment 8466496 [details] [diff] [review] Adds helper functions to test permissions on PrincipalInfos off the main thread at the cost of locking. Does not affect main thread performance. Awaiting review.
Adding Jed who had to do some sad workarounds in the past involving proxying calls to the main thread in order to read from the nsIPermissionManager. Once this bug is fixed we should be able to simplify that a whole lot.
Seems we are no longer concerned with this.
Status: ASSIGNED → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → INCOMPLETE
I would have thought that we need this in order to implement persistent storage. I would expect the quota manager to need to check if a given origin has been given persistent permission or not, and that this check needs to happen on a background thread. Of course, we can always proxy to the main thread and do the check there. But the goal of this bug is to not having to re-invent that wheel every time (and also save some perf)
For reference: if memory serves, comment #2 was about bug 976398, and that's B2G-specific. But it sounds like comment #0 might have had other things in mind.
You need to log in before you can comment on or make changes to this bug.