Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add webidl annotation to pass InCompartment argument to DOM methods #23257

Closed
jdm opened this issue Apr 24, 2019 · 3 comments
Closed

Add webidl annotation to pass InCompartment argument to DOM methods #23257

jdm opened this issue Apr 24, 2019 · 3 comments

Comments

@jdm
Copy link
Member

@jdm jdm commented Apr 24, 2019

Based on the work in #23253:

Let's add a new in_compartment property to this configuration - for a given interface, this property will be a list of method/property names that expect to receive InCompartment arguments.

We will need to store this in_compartment in this code so we can query it later during code generation.

The easiest place to start is with methods in this code. We can treat this similarly to deciding whether to provide a *mut JSContext argument or not, by making the caller tell us whether this is a method that should provide an InCompartment argument or not.

@jdm
Copy link
Member Author

@jdm jdm commented Apr 24, 2019

It's easiest to start small here - make the fetch method from Window.webidl take an InCompartment object, and adjust the code generation until everything lines up.

@Eijebong
Copy link
Member

@Eijebong Eijebong commented May 25, 2019

Should all the methods asserting AlreadyInCompartment use that ?

@jdm
Copy link
Member Author

@jdm jdm commented May 25, 2019

That's the idea behind this work, yes.

bors-servo added a commit that referenced this issue Jun 2, 2019
Add an inCompartments config option for bindings

Fixes #23257

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23459)
<!-- Reviewable:end -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

2 participants
You can’t perform that action at this time.