Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2990390

Browse filesBrowse files
authored
inspector: simplify dispatchProtocolMessage
PR-URL: #49780 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
1 parent 813713f commit 2990390
Copy full SHA for 2990390

File tree

Expand file treeCollapse file tree

5 files changed

+2
-27
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

5 files changed

+2
-27
lines changed
Open diff view settings
Collapse file

‎src/inspector/node_string.cc‎

Copy file name to clipboardExpand all lines: src/inspector/node_string.cc
-10Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -97,16 +97,6 @@ double toDouble(const char* buffer, size_t length, bool* ok) {
9797
return d;
9898
}
9999

100-
std::unique_ptr<Value> parseMessage(const std::string_view message,
101-
bool binary) {
102-
if (binary) {
103-
return Value::parseBinary(
104-
reinterpret_cast<const uint8_t*>(message.data()),
105-
message.length());
106-
}
107-
return parseJSON(message);
108-
}
109-
110100
ProtocolMessage jsonToMessage(String message) {
111101
return message;
112102
}
Collapse file

‎src/inspector/node_string.h‎

Copy file name to clipboardExpand all lines: src/inspector/node_string.h
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ void builderAppendQuotedString(StringBuilder& builder, const std::string_view);
6868
std::unique_ptr<Value> parseJSON(const std::string_view);
6969
std::unique_ptr<Value> parseJSON(v8_inspector::StringView view);
7070

71-
std::unique_ptr<Value> parseMessage(const std::string_view message,
72-
bool binary);
7371
ProtocolMessage jsonToMessage(String message);
7472
ProtocolMessage binaryToMessage(std::vector<uint8_t> message);
7573
String fromUTF8(const uint8_t* data, size_t length);
Collapse file

‎src/inspector_agent.cc‎

Copy file name to clipboardExpand all lines: src/inspector_agent.cc
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,8 @@ class ChannelImpl final : public v8_inspector::V8Inspector::Channel,
253253
"[inspector received] %s\n",
254254
raw_message);
255255
std::unique_ptr<protocol::DictionaryValue> value =
256-
protocol::DictionaryValue::cast(protocol::StringUtil::parseMessage(
257-
raw_message, false));
256+
protocol::DictionaryValue::cast(
257+
protocol::StringUtil::parseJSON(message));
258258
int call_id;
259259
std::string method;
260260
node_dispatcher_->parseCommand(value.get(), &call_id, &method);
Collapse file

‎tools/inspector_protocol/lib/base_string_adapter_cc.template‎

Copy file name to clipboardExpand all lines: tools/inspector_protocol/lib/base_string_adapter_cc.template
-12Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -128,18 +128,6 @@ std::unique_ptr<base::Value> toBaseValue(Value* value, int depth) {
128128
return nullptr;
129129
}
130130

131-
// static
132-
std::unique_ptr<Value> StringUtil::parseMessage(
133-
const std::string& message, bool binary) {
134-
if (binary) {
135-
return Value::parseBinary(
136-
reinterpret_cast<const uint8_t*>(message.data()),
137-
message.length());
138-
}
139-
std::unique_ptr<base::Value> value = base::JSONReader::ReadDeprecated(message);
140-
return toProtocolValue(value.get(), 1000);
141-
}
142-
143131
// static
144132
ProtocolMessage StringUtil::jsonToMessage(String message) {
145133
return message;
Collapse file

‎tools/inspector_protocol/lib/base_string_adapter_h.template‎

Copy file name to clipboardExpand all lines: tools/inspector_protocol/lib/base_string_adapter_h.template
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ class {{config.lib.export_macro}} StringUtil {
9292
return builder.toString();
9393
}
9494

95-
static std::unique_ptr<Value> parseMessage(const std::string& message, bool binary);
9695
static ProtocolMessage jsonToMessage(String message);
9796
static ProtocolMessage binaryToMessage(std::vector<uint8_t> message);
9897

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.