Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Feldman <pfeldman@chromium.org>2019-02-25 23:43:13 +0300
committerRefael Ackermann <refack@gmail.com>2019-03-04 19:44:49 +0300
commitd775d74698e1b321580b1560fbcee7943750aedc (patch)
treee603e6285066de1e55a25397deef5edd41959887 /src/inspector_agent.cc
parentb2abda9ba0b7b8bfbbf14e990ea86434f3f20de3 (diff)
tools: roll inspector_protocol to f67ec5
Fixes: https://github.com/nodejs/node/issues/25808 PR-URL: https://github.com/nodejs/node/pull/26303 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Refael Ackermann <refack@gmail.com>
Diffstat (limited to 'src/inspector_agent.cc')
-rw-r--r--src/inspector_agent.cc22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/inspector_agent.cc b/src/inspector_agent.cc
index 82d96e7ef7f..2376ae50044 100644
--- a/src/inspector_agent.cc
+++ b/src/inspector_agent.cc
@@ -236,15 +236,19 @@ class ChannelImpl final : public v8_inspector::V8Inspector::Channel,
}
std::string dispatchProtocolMessage(const StringView& message) {
- std::unique_ptr<protocol::DictionaryValue> parsed;
+ std::string raw_message = protocol::StringUtil::StringViewToUtf8(message);
+ std::unique_ptr<protocol::DictionaryValue> value =
+ protocol::DictionaryValue::cast(protocol::StringUtil::parseMessage(
+ raw_message, false));
+ int call_id;
std::string method;
- node_dispatcher_->getCommandName(
- protocol::StringUtil::StringViewToUtf8(message), &method, &parsed);
+ node_dispatcher_->parseCommand(value.get(), &call_id, &method);
if (v8_inspector::V8InspectorSession::canDispatchMethod(
Utf8ToStringView(method)->string())) {
session_->dispatchProtocolMessage(message);
} else {
- node_dispatcher_->dispatch(std::move(parsed));
+ node_dispatcher_->dispatch(call_id, method, std::move(value),
+ raw_message);
}
return method;
}
@@ -284,11 +288,17 @@ class ChannelImpl final : public v8_inspector::V8Inspector::Channel,
void sendProtocolResponse(int callId,
std::unique_ptr<Serializable> message) override {
- sendMessageToFrontend(message->serialize());
+ sendMessageToFrontend(message->serializeToJSON());
}
void sendProtocolNotification(
std::unique_ptr<Serializable> message) override {
- sendMessageToFrontend(message->serialize());
+ sendMessageToFrontend(message->serializeToJSON());
+ }
+
+ void fallThrough(int callId,
+ const std::string& method,
+ const std::string& message) override {
+ DCHECK(false);
}
std::unique_ptr<protocol::TracingAgent> tracing_agent_;