Commit 1dd758e3 authored by Andrey Kosyakov's avatar Andrey Kosyakov Committed by V8 LUCI CQ

Roll inspector_protocol to 35e8d2d89cb017d72cf905362672de77c978e1e

Change-Id: I81ff7fca841015ebc8cee66546ab40efb3065731
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2892842Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Commit-Queue: Andrey Kosyakov <caseq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74575}
parent aebe382a
......@@ -2,7 +2,7 @@ Name: inspector protocol
Short Name: inspector_protocol
URL: https://chromium.googlesource.com/deps/inspector_protocol/
Version: 0
Revision: 94298cef795ec994106bdaff002c41182911b767
Revision: 35e8d2d89cb017d72cf905362672de77c978e1e6
License: BSD
License File: LICENSE
Security Critical: no
......
......@@ -4,6 +4,8 @@
#include "serializable.h"
#include <utility>
namespace v8_crdtp {
// =============================================================================
// Serializable - An object to be emitted as a sequence of bytes.
......@@ -18,7 +20,8 @@ std::vector<uint8_t> Serializable::Serialize() const {
namespace {
class PreSerialized : public Serializable {
public:
explicit PreSerialized(std::vector<uint8_t> bytes) : bytes_(bytes) {}
explicit PreSerialized(std::vector<uint8_t> bytes)
: bytes_(std::move(bytes)) {}
void AppendSerialized(std::vector<uint8_t>* out) const override {
out->insert(out->end(), bytes_.begin(), bytes_.end());
......
......@@ -113,6 +113,8 @@ std::string Status::Message() const {
return "BINDINGS: string8 value expected";
case Error::BINDINGS_BINARY_VALUE_EXPECTED:
return "BINDINGS: binary value expected";
case Error::BINDINGS_DICTIONARY_VALUE_EXPECTED:
return "BINDINGS: dictionary value expected";
}
// Some compilers can't figure out that we can't get here.
return "INVALID ERROR CODE";
......
......@@ -77,6 +77,7 @@ enum class Error {
BINDINGS_STRING_VALUE_EXPECTED = 0x34,
BINDINGS_STRING8_VALUE_EXPECTED = 0x35,
BINDINGS_BINARY_VALUE_EXPECTED = 0x36,
BINDINGS_DICTIONARY_VALUE_EXPECTED = 0x37,
};
// A status value with position that can be copied. The default status
......
......@@ -96,6 +96,10 @@ bool ProtocolTypeTraits<std::unique_ptr<DictionaryValue>>::Deserialize(
std::unique_ptr<Value> res;
if (!ProtocolTypeTraits<std::unique_ptr<Value>>::Deserialize(state, &res))
return false;
if (res->type() != Value::TypeObject) {
state->RegisterError(Error::BINDINGS_DICTIONARY_VALUE_EXPECTED);
return false;
}
*value = DictionaryValue::cast(std::move(res));
return true;
}
......
......@@ -11,7 +11,6 @@
#include "base/base64.h"
#include "base/json/json_reader.h"
#include "base/memory/ptr_util.h"
#include "base/strings/string16.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
......@@ -141,7 +140,7 @@ std::unique_ptr<base::Value> toBaseValue(Value* value, int depth) {
// static
String StringUtil::fromUTF16LE(const uint16_t* data, size_t length) {
std::string utf8;
base::UTF16ToUTF8(reinterpret_cast<const base::char16*>(data), length, &utf8);
base::UTF16ToUTF8(reinterpret_cast<const char16_t*>(data), length, &utf8);
return utf8;
}
......@@ -246,4 +245,4 @@ void ProtocolTypeTraits<Binary>::Serialize(const Binary& value, std::vector<uint
value.AppendSerialized(bytes);
}
} // namespace {{config.crdtp.namespace}}
\ No newline at end of file
} // namespace {{config.crdtp.namespace}}
......@@ -27,6 +27,9 @@ def assignType(item, type, is_array=False, map_binary_to_string=False):
type = 'string'
if map_binary_to_string and type == 'binary':
type = 'string'
if 'description' in item:
item['description'] = (item['description'] +
' (Encoded as a base64 string when passed over JSON)')
if type in primitiveTypes:
item['type'] = type
else:
......
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