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

SerialPortInfo should be more specific about keys. #91

Closed
asankah opened this issue Jun 30, 2020 · 3 comments
Closed

SerialPortInfo should be more specific about keys. #91

asankah opened this issue Jun 30, 2020 · 3 comments

Comments

@asankah
Copy link

asankah commented Jun 30, 2020

As currently defined, the SerialPortInfo (permalink) is a generic maplike.

For the sake of being able to reason about information exposed explicitly, can the interface define the keys as constants? Even better would be to just introduce attributes with defined behavior when the specific property is not available.

@reillyeon
Copy link
Collaborator

There is a long discussion of this on #20 and I will admit that after reading it I still don't understand why a maplike was chosen. In the current Chromium prototype a dictionary is used instead. I'm planning to change the specification to match.

Nevertheless, the current specification does seem to be reasonably specific about the set of recommended keys. I am planning on changing some of them. Please see crbug/1074383 for some of my recent thoughts.

@asankah
Copy link
Author

asankah commented Jun 30, 2020

Thanks for the pointers! I agree with your thoughts and direction in the Chromium bug.

The existence of keys like serialNumber was the reason that this came up during review. Having specific keys in the IDL and explained in the spec makes reviewing and auditing a bit more straightforward. Otherwise bits of information that are very relevant and should be carefully vetted can go overlooked.

In some ways the difference is superficial. Also in the case of the Serial API there's likely no practical way to prevent some identifier from being transferred in-band. So it's not a strong request.

@reillyeon
Copy link
Collaborator

This interface has been replaced by a dictionary with specific keys in #105.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants