Closed
Bug 1048695
Opened 10 years ago
Closed 9 years ago
Allow use of [Exposed] to control interface member visibility
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
mozilla45
Tracking | Status | |
---|---|---|
firefox45 | --- | fixed |
People
(Reporter: bzbarsky, Assigned: bzbarsky)
References
(Blocks 1 open bug)
Details
Attachments
(2 files, 1 obsolete file)
15.34 KB,
patch
|
peterv
:
review+
|
Details | Diff | Splinter Review |
6.40 KB,
patch
|
peterv
:
review+
|
Details | Diff | Splinter Review |
Right now we have cases in which we use [Exposed] to completely suppress codegen of some members, but we'd like to be able to use it to control visibility too. I'd like to first fix bug 1011826, while keeping this bug in mind.
Assignee | ||
Comment 1•9 years ago
|
||
Attachment #8689732 -
Flags: review?(peterv)
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•9 years ago
|
||
Attachment #8689733 -
Flags: review?(peterv)
Updated•9 years ago
|
Blocks: 2D-OffscreenCanvas
Assignee | ||
Comment 3•9 years ago
|
||
Attachment #8693600 -
Flags: review?(peterv)
Assignee | ||
Updated•9 years ago
|
Attachment #8689733 -
Attachment is obsolete: true
Attachment #8689733 -
Flags: review?(peterv)
Comment 4•9 years ago
|
||
Comment on attachment 8689732 [details] [diff] [review] part 1. Pass the set of globals where a member should NOT be exposed to MemberCondition Review of attachment 8689732 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/bindings/Codegen.py @@ +2040,5 @@ > + if workerDesc.workers: > + # Just drop all the worker interface names from the > + # nonExposureSet, since we know we'll have a mainthread global > + # of some sort. > + nonExposureSet.difference_update(interface.getWorkerExposureSet()) Could this make nonExposureSet be empty? Might be a good idea to make MemberCondition's __init__ assert None or non-zero length set anyway?
Attachment #8689732 -
Flags: review?(peterv) → review+
Comment 5•9 years ago
|
||
Comment on attachment 8693600 [details] [diff] [review] part 2. Make interface members not be exposed based on their nonExposedGlobals Review of attachment 8693600 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/bindings/BindingUtils.h @@ +3182,5 @@ > +// Returns true if the given global is of a type whose bit is set in > +// aNonExposedGlobals. > +bool > +IsNonExposedGlobal(JSContext* aCx, JSObject* aGlobal, > + uint32_t aNonExposedGlobals); Could we just use the declaration in DOMJSClass instead of having it twice?
Attachment #8693600 -
Flags: review?(peterv) → review+
Assignee | ||
Comment 6•9 years ago
|
||
> Could this make nonExposureSet be empty? I could. In fact, it's supposed to. The idea is that we shouldn't add any extra checks in this case. That's why the check in MemberCondition.__init__ is whether nonExposedGlobals is truthy, not whether it's None. An empty set is falsy, so will lead to self.nonExposedGlobals being set to 0. I will adjust the MemberCondition documentation to make it clear that empty set is explicitly OK there. > Could we just use the declaration in DOMJSClass instead of having it twice? Good catch. We can. And the same for CheckAnyPermissions/CheckAllPermissions. I'll move the docs there.
https://hg.mozilla.org/integration/mozilla-inbound/rev/60d26cef51f1 https://hg.mozilla.org/integration/mozilla-inbound/rev/cfd1e40e0248
Comment 8•9 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/60d26cef51f1 https://hg.mozilla.org/mozilla-central/rev/cfd1e40e0248
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox45:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
Updated•5 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•