Skip to content

Commit ea5f204

Browse files
Trotttargos
authored andcommitted
inspector: update inspector_protocol to 8ec18cf
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>
1 parent 60f41c3 commit ea5f204

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tools/inspector_protocol/lib/Values_cpp.template

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,12 @@ std::unique_ptr<DictionaryValue> parseMap(
178178
key = StringUtil::fromUTF8(key_span.data(), key_span.size());
179179
tokenizer->Next();
180180
} else if (tokenizer->TokenTag() == cbor::CBORTokenTag::STRING16) {
181-
return nullptr; // STRING16 not supported yet.
181+
span<uint8_t> key_span = tokenizer->GetString16WireRep();
182+
if (key_span.size() & 1) return nullptr; // UTF16 is 2 byte multiple.
183+
key = StringUtil::fromUTF16(
184+
reinterpret_cast<const uint16_t*>(key_span.data()),
185+
key_span.size() / 2);
186+
tokenizer->Next();
182187
} else {
183188
// Error::CBOR_INVALID_MAP_KEY
184189
return nullptr;

0 commit comments

Comments
 (0)