Skip to content

Commit

Permalink
inspector: update inspector_protocol to 8ec18cf
Browse files Browse the repository at this point in the history
Apply 8ec18cf: "Support STRING16 in the template when converting CBOR
map keys"

Refs: https://chromium.googlesource.com/deps/inspector_protocol/+/8ec18cf0885bef0b5c2a922c5dc3813cbf63e962

We're over 2 years out of date in the tools/inspector_protocol directory
and I have to imagine this will come back to bite us at some point. But
I also don't want to do a huge update all at once, so starting with a
single commit. I might bundle commits together a bit more if this goes
well.

PR-URL: #39614
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
  • Loading branch information
Trott authored and danielleadams committed Aug 16, 2021
1 parent 7a91d4b commit 793fee4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tools/inspector_protocol/lib/Values_cpp.template
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,12 @@ std::unique_ptr<DictionaryValue> parseMap(
key = StringUtil::fromUTF8(key_span.data(), key_span.size());
tokenizer->Next();
} else if (tokenizer->TokenTag() == cbor::CBORTokenTag::STRING16) {
return nullptr; // STRING16 not supported yet.
span<uint8_t> key_span = tokenizer->GetString16WireRep();
if (key_span.size() & 1) return nullptr; // UTF16 is 2 byte multiple.
key = StringUtil::fromUTF16(
reinterpret_cast<const uint16_t*>(key_span.data()),
key_span.size() / 2);
tokenizer->Next();
} else {
// Error::CBOR_INVALID_MAP_KEY
return nullptr;
Expand Down

0 comments on commit 793fee4

Please sign in to comment.