[mediacapture-region] What makes CropTarget special to require an asynchronous creation? (#17)

youennf has just created a new issue for https://github.com/w3c/mediacapture-region:

== What makes CropTarget special to require an asynchronous creation? ==
We started discussing this topic (whether CropTarget creation should use promise or not) as part of https://github.com/w3c/mediacapture-region/issues/11 and it seems best to use a dedicated thread for this issue.

@eladalon1983  mentioned implementation issues that make using promises desirable, in particular security and potential race conditions if creating synchronously a CropTarget since CropTarget has to keep a link to the process it was created in. The following case was provided:
- create CropTarget in process A
- postMessage it synchronously to another process B
- (optionally) postMessage it yet again to another process C
- Use CropTarget to crop the track.
@eladalon1983, please correct this description if it is not aligned with your thoughts.

Existing objects like MessagePort, WHATWG Streams, RTCDataChannel or MediaStreamTrack can be created-then-postMessaged synchronously and UAs are implementing this today, hopefully without the security/race condition issues.
AIUI, it seems consistent to use the same approach to CropTarget (synchronous creation), except if we find anything specific to CropTarget that actually prevents this existing pattern.

Please view or discuss this issue at https://github.com/w3c/mediacapture-region/issues/17 using your GitHub account

Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 2 February 2022 09:28:23 UTC