inspector: fix StringUtil::CharacterCount for unicodes

`StringUtil::CharacterCount` should return the length of underlying
representation storage of a protocol string.

`StringUtil::CharacterCount` is only used in DictionaryValue
serialization. Only `Network.Headers` is an object type, represented
with DictionaryValue.

PR-URL: https://github.com/nodejs/node/pull/56788
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Daniel Lemire <daniel@lemire.me>
Reviewed-By: Kohei Ueno <kohei.ueno119@gmail.com>
This commit is contained in:
Chengzhong Wu 2025-01-29 14:58:25 +00:00 committed by GitHub
parent 671d058689
commit 0edeafd73d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 122 additions and 6 deletions

View file

@ -432,6 +432,7 @@
'test/cctest/test_quic_tokens.cc',
],
'node_cctest_inspector_sources': [
'test/cctest/inspector/test_node_protocol.cc',
'test/cctest/test_inspector_socket.cc',
'test/cctest/test_inspector_socket_server.cc',
],
@ -1210,6 +1211,14 @@
'HAVE_INSPECTOR=1',
],
'sources': [ '<@(node_cctest_inspector_sources)' ],
'include_dirs': [
# TODO(legendecas): make node_inspector.gypi a dependable target.
'<(SHARED_INTERMEDIATE_DIR)', # for inspector
'<(SHARED_INTERMEDIATE_DIR)/src', # for inspector
],
'dependencies': [
'deps/inspector_protocol/inspector_protocol.gyp:crdtp',
],
}, {
'defines': [
'HAVE_INSPECTOR=0',