Closed
Bug 1453633
Opened 7 years ago
Closed 7 years ago
Make nsHostObjectURI hold a threadsafe wrapper of nsIPrincipal
Categories
(Core :: DOM: File, enhancement)
Core
DOM: File
Tracking
()
RESOLVED
FIXED
mozilla61
Tracking | Status | |
---|---|---|
firefox61 | --- | fixed |
People
(Reporter: valentin, Assigned: valentin)
References
Details
(Whiteboard: [necko-triaged])
Attachments
(1 file)
The problem of principals was pointed out in bug 1448328. They are not threadsafe yet, and addref-ing/releasing them OMT is not possible at the moment.
The easy solution to make nsHostObjectURI usable/clonable OMT is to make it hold a threadsafe wrapper containing the principal object.
Once created on the main thread, it can be addref-ed on any thread, and when its refcount reaches 0 we dispatch to the main thread to release the principal.
Comment hidden (mozreview-request) |
Comment 2•7 years ago
|
||
mozreview-review |
Comment on attachment 8967391 [details]
Bug 1453633 - Make nsHostObjectURI hold its principal wrapped in a nsMainThreadPtrHandle
https://reviewboard.mozilla.org/r/236068/#review241820
::: dom/file/nsHostObjectURI.h:103
(Diff revision 1)
> }
>
> MOZ_MUST_USE NS_IMETHOD
> SetPrincipal(nsIPrincipal *aPrincipal) override
> {
> if (!mURI) {
MOZ_ASSERT(NS_IsMainThread())
Attachment #8967391 -
Flags: review?(amarchesini) → review+
Comment hidden (mozreview-request) |
Pushed by valentin.gosu@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/165ff300ac95
Make nsHostObjectURI hold its principal wrapped in a nsMainThreadPtrHandle r=baku
Comment 5•7 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
You need to log in
before you can comment on or make changes to this bug.
Description
•