Commit 54bd00af authored by Johannes Henkel's avatar Johannes Henkel Committed by Commit Bot

[DevTools] Roll inspector_protocol (v8)

New Revision: bbc72612409377752c8fd2e7a63a1a5947b7dc4b

Change-Id: I625c056b35ffa0658a9063da52ec17178db213a7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1866967Reviewed-by: 's avatarAlexei Filippov <alph@chromium.org>
Commit-Queue: Johannes Henkel <johannes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64392}
parent e358d29e
......@@ -2,7 +2,7 @@ Name: inspector protocol
Short Name: inspector_protocol
URL: https://chromium.googlesource.com/deps/inspector_protocol/
Version: 0
Revision: a14dad30f0e5b0fc05911856d5a20b1ffe89fd9b
Revision: bbc72612409377752c8fd2e7a63a1a5947b7dc4b
License: BSD
License File: LICENSE
Security Critical: no
......
......@@ -142,11 +142,6 @@ public:
return std::unique_ptr<ProtocolError>(new ProtocolError(code, errorMessage));
}
String serializeToJSON() override
{
return serialize()->serializeToJSON();
}
std::vector<uint8_t> serializeToBinary() override
{
return serialize()->serializeToBinary();
......@@ -319,20 +314,6 @@ std::unique_ptr<Serializable> InternalResponse::createErrorResponse(int callId,
return ProtocolError::createErrorResponse(callId, code, message, nullptr);
}
String InternalResponse::serializeToJSON()
{
std::unique_ptr<DictionaryValue> result = DictionaryValue::create();
std::unique_ptr<Serializable> params(m_params ? std::move(m_params) : DictionaryValue::create());
if (m_notification.length()) {
result->setString("method", m_notification);
result->setValue("params", SerializedValue::fromJSON(params->serializeToJSON()));
} else {
result->setInteger("id", m_callId);
result->setValue("result", SerializedValue::fromJSON(params->serializeToJSON()));
}
return result->serializeToJSON();
}
std::vector<uint8_t> InternalResponse::serializeToBinary()
{
std::unique_ptr<DictionaryValue> result = DictionaryValue::create();
......
......@@ -132,7 +132,6 @@ public:
static std::unique_ptr<Serializable> createNotification(const String& notification, std::unique_ptr<Serializable> params = nullptr);
static std::unique_ptr<Serializable> createErrorResponse(int callId, DispatchResponse::ErrorCode code, const String& message);
String serializeToJSON() override;
std::vector<uint8_t> serializeToBinary() override;
~InternalResponse() override {}
......@@ -147,11 +146,6 @@ private:
class InternalRawNotification : public Serializable {
public:
static std::unique_ptr<InternalRawNotification> fromJSON(String notification)
{
return std::unique_ptr<InternalRawNotification>(new InternalRawNotification(std::move(notification)));
}
static std::unique_ptr<InternalRawNotification> fromBinary(std::vector<uint8_t> notification)
{
return std::unique_ptr<InternalRawNotification>(new InternalRawNotification(std::move(notification)));
......@@ -159,23 +153,15 @@ public:
~InternalRawNotification() override {}
String serializeToJSON() override
{
return std::move(m_jsonNotification);
}
std::vector<uint8_t> serializeToBinary() override
{
return std::move(m_binaryNotification);
}
private:
explicit InternalRawNotification(String notification)
: m_jsonNotification(std::move(notification)) { }
explicit InternalRawNotification(std::vector<uint8_t> notification)
: m_binaryNotification(std::move(notification)) { }
String m_jsonNotification;
std::vector<uint8_t> m_binaryNotification;
};
......
......@@ -13,13 +13,6 @@ namespace {{namespace}} {
class {{config.lib.export_macro}} Serializable {
public:
ProtocolMessage serialize(bool binary) {
if (binary)
return StringUtil::binaryToMessage(serializeToBinary());
else
return StringUtil::jsonToMessage(serializeToJSON());
}
virtual String serializeToJSON() = 0;
virtual std::vector<uint8_t> serializeToBinary() = 0;
virtual ~Serializable() = default;
};
......
......@@ -299,10 +299,6 @@ String Value::toJSONString() const
return StringUtil::builderToString(result);
}
String Value::serializeToJSON() {
return toJSONString();
}
std::vector<uint8_t> Value::serializeToBinary() {
std::vector<uint8_t> bytes;
writeBinary(&bytes);
......
......@@ -57,7 +57,6 @@ public:
virtual void writeBinary(std::vector<uint8_t>* bytes) const;
virtual std::unique_ptr<Value> clone() const;
String toJSONString() const;
String serializeToJSON() override;
std::vector<uint8_t> serializeToBinary() override;
protected:
......
......@@ -101,7 +101,7 @@ std::unique_ptr<{{type.id}}> {{type.id}}::clone() const
{{config.exported.string_out}} {{type.id}}::toJSONString() const
{
String json = toValue()->serializeToJSON();
String json = toValue()->toJSONString();
return {{config.exported.to_string_out % "json"}};
}
......@@ -203,11 +203,6 @@ void Frontend::flush()
m_frontendChannel->flushProtocolNotifications();
}
void Frontend::sendRawJSONNotification(String notification)
{
m_frontendChannel->sendProtocolNotification(InternalRawNotification::fromJSON(std::move(notification)));
}
void Frontend::sendRawCBORNotification(std::vector<uint8_t> notification)
{
m_frontendChannel->sendProtocolNotification(InternalRawNotification::fromBinary(std::move(notification)));
......
......@@ -100,7 +100,6 @@ public:
{% endfor %}
std::unique_ptr<protocol::DictionaryValue> toValue() const;
String serializeToJSON() override { return toValue()->serializeToJSON(); }
std::vector<uint8_t> serializeToBinary() override { return toValue()->serializeToBinary(); }
String toJSON() const { return toValue()->toJSONString(); }
std::unique_ptr<{{type.id}}> clone() const;
......@@ -269,7 +268,6 @@ public:
{% endfor %}
void flush();
void sendRawJSONNotification(String);
void sendRawCBORNotification(std::vector<uint8_t>);
private:
FrontendChannel* m_frontendChannel;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment