-
Notifications
You must be signed in to change notification settings - Fork 40
Issue 387: Need to make sure we have a display list for start(). #390
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
Conversation
I see why cleaning up the temporary presentation availability display could be useful but, while stupid, cannot an app call This triggers another issue, actually: when can the presentation display availability be garbage collected? I read the current In turn, this would mean that the garbage collection steps envisioned in the monitoring section will never run: "When a Am I reading this correctly? If so, the above GC steps need fixing. If not, I think the spec needs to be clearer that the presentation display availability and the presentation availability promise may be collected at any time (well, the promise must be collected before the availability object, since it contains a pointer to it). |
Is it possible for the If so, we could have
Association of an availability object with a request shouldn't create a strong reference for the purposes of GC. It's to prevent creation of duplicate objects. How do specs label kinds of ownership of objects for GC purposes?
They should be collected like any other object, when they go out of scope for the associated script context's scope. We should be more specific about the relationships among these objects so GC behavior is clear. |
It seems possible at least given that steps run in parallel each time.
It seems strange to tie the result of
Right, that would solve the problem.
I don't remember having seen strong/weak terminology used in other specs but maybe I missed something. It is not unusual to see garbage collection sections that describe when objects can be collected though. I do not know if there is an implicit default that the "internal slots" that a spec may use are weak references. It seems a good idea to be explicit about the intent in any case.
OK, then below is how I would fix this issue and clarify GC behavior. Happy to craft a PR if you think that's a good approach. In
|
Overall I like the approach you propose, here are a few things I noted. Go ahead with a PR when you are ready.
Sounds good.
That would simplify things; but Web developers would need to make sure to expunge references to any Promises as well as the resulting availability object, in order for the availability object to be garbage collected. This is a valid idiom for Promise-vending APIs, and I don't object to it.
Since the monitoring steps run in parallel, if
This is how Web Bluetooth puts it:
Or we could just say "is eligible for garbage collection?" It gets tricky because a script context can have multiple Realms / settings objects - so we would need to be specific about which one applies. See Issue #391 I filed. |
This PR is obsoleted by PR #387. |
Addresses issue #387: Filling out the list of available presentation displays for start.
If there is no existing presentation display availability for the request, creates a temporary one and runs the steps to monitor. The temporary one is removed at the end of
start()
.