Closed Bug 1316619 Opened 9 years ago Closed 9 years ago

Add a [NeedsCallerType] IDL annotation

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla52
Tracking Status
firefox52 --- fixed

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

See discussion in bug 1316480. I'm going to build it on top of IsCallerChrome/ThreadsafeIsCallerChrome for now, I guess. Once bug 1316616 is sorted out we can change to that.
Per IRC discussion, will do a mozilla::dom::CallerType enum.
Summary: Add a [NeedsCallerIsSystem] IDL annotation → Add a [NeedsCallerType] IDL annotation
Attachment #8809484 - Flags: review?(bobbyholley)
Comment on attachment 8809484 [details] [diff] [review] Add a [NeedsCallerType] WebIDL annotation Review of attachment 8809484 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/bindings/Codegen.py @@ +14085,5 @@ > # And the nsIPrincipal > if self.member.getExtendedAttribute('NeedsSubjectPrincipal'): > + # Cheat and assume self.descriptorProvider is a descriptor > + if self.descriptorProvider.interface.isExposedInAnyWorker(): > + args.append(Argument("Maybe<nsIPrincipal*>", "aSubjectPrincipal")) I don't see the code changes that cause us to set this Maybe<> up when being called from JS (instead of the nsIPrincipal& we had before). And isn't that whole thing kind of orthogonal to your patch here? ::: dom/bindings/test/TestExampleGen.webidl @@ +806,5 @@ > +interface TestExampleWorkerInterface { > + [NeedsSubjectPrincipal] void needsSubjectPrincipalMethod(); > + [NeedsSubjectPrincipal] attribute boolean needsSubjectPrincipalAttr; > + [NeedsCallerType] void needsCallerTypeMethod(); > + [NeedsCallerType] attribute boolean needsCallerTypeAttr; Nit: whitespace.
Attachment #8809484 - Flags: review?(bobbyholley) → review+
> And isn't that whole thing kind of orthogonal to your patch here? It's orthogonal in the sense that the code to pass Maybe<nsIPrincipal*> already exists. I just encountered this bug in the example codegen when I added a worker-exposed interface that exercised some of this stuff, including my new thing... I suppose I could have spun this part off to a separate patch, sorry.
Blocks: 1316661
Pushed by bzbarsky@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/a0d9aedec307 Add a [NeedsCallerType] WebIDL annotation. r=bholley
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: