Allow permissions to be read off the main thread

RESOLVED INCOMPLETE

Status

()

Core
Permission Manager
RESOLVED INCOMPLETE
4 years ago
2 years ago

People

(Reporter: Ben Turner (not reading bugmail, use the needinfo flag!), Assigned: Fill)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

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.
(Assignee)

Comment 1

4 years ago
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.
Attachment #8466496 - Flags: review?(bent.mozilla)
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.
Attachment #8466496 - Flags: review?(bent.mozilla)
You need to log in before you can comment on or make changes to this bug.