Consider renaming ByteString to HTTPHeaderString?
The only places ByteString is used on the platform are:
- XHR, Fetch, and Service Worker APIs dealing with HTTP headers
- The return value of atob.
The latter could be easily converted to a DOMString (since it's a return value this has no change in semantics). And then we could do the proposed rename to make it clear when ByteString is reasonable to use on the web platform.
Thoughts?
HTTPHeaderString could be a bit confusing. "\x04" is not a valid character in an HTTP header, but is a valid ByteString value.
I think it's fine to use for all cases where you have a byte sequence and want to return it isomomorphic decoded for convenience. It's typically network APIs that need this as they never adopted Unicode.
E.g., I think https://w3c.github.io/resource-timing/#dom-performanceresourcetiming-nexthopprotocol should use it too. (Tracked in https://github.com/w3c/resource-timing/issues/274.)