inspector: simplify dispatchProtocolMessage

PR-URL: https://github.com/nodejs/node/pull/49780
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
This commit is contained in:
Daniel Lemire authored and GitHub committed 2023-09-30 01:58:09 +00:00
1 parent 813713f211
commit 2990390359
5 files changed
+2 -27

No files matched your search

@@ -128,18 +128,6 @@ std::unique_ptr<base::Value> toBaseValue(Value* value, int depth) {
return nullptr;
}
// static
std::unique_ptr<Value> StringUtil::parseMessage(
const std::string& message, bool binary) {
if (binary) {
return Value::parseBinary(
reinterpret_cast<const uint8_t*>(message.data()),
message.length());
}
std::unique_ptr<base::Value> value = base::JSONReader::ReadDeprecated(message);
return toProtocolValue(value.get(), 1000);
}
// static
ProtocolMessage StringUtil::jsonToMessage(String message) {
return message;
@@ -92,7 +92,6 @@ class {{config.lib.export_macro}} StringUtil {
return builder.toString();
}
static std::unique_ptr<Value> parseMessage(const std::string& message, bool binary);
static ProtocolMessage jsonToMessage(String message);
static ProtocolMessage binaryToMessage(std::vector<uint8_t> message);