aboutsummaryrefslogtreecommitdiff
path: root/deps/v8/third_party/inspector_protocol/lib/Values_cpp.template
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/third_party/inspector_protocol/lib/Values_cpp.template')
-rw-r--r--deps/v8/third_party/inspector_protocol/lib/Values_cpp.template28
1 files changed, 26 insertions, 2 deletions
diff --git a/deps/v8/third_party/inspector_protocol/lib/Values_cpp.template b/deps/v8/third_party/inspector_protocol/lib/Values_cpp.template
index 7d3b907a26..038992f684 100644
--- a/deps/v8/third_party/inspector_protocol/lib/Values_cpp.template
+++ b/deps/v8/third_party/inspector_protocol/lib/Values_cpp.template
@@ -6,6 +6,8 @@
//#include "Values.h"
+#include "{{config.encoding_lib.header}}"
+
{% for namespace in config.protocol.namespace %}
namespace {{namespace}} {
{% endfor %}
@@ -64,6 +66,28 @@ void escapeStringForJSONInternal(const Char* str, unsigned len,
// to this constant.
static constexpr int kStackLimitValues = 1000;
+using {{config.encoding_lib.namespace}}::Error;
+using {{config.encoding_lib.namespace}}::Status;
+using {{config.encoding_lib.namespace}}::span;
+namespace cbor {
+using {{config.encoding_lib.namespace}}::cbor::CBORTokenTag;
+using {{config.encoding_lib.namespace}}::cbor::CBORTokenizer;
+using {{config.encoding_lib.namespace}}::cbor::EncodeBinary;
+using {{config.encoding_lib.namespace}}::cbor::EncodeDouble;
+using {{config.encoding_lib.namespace}}::cbor::EncodeFalse;
+using {{config.encoding_lib.namespace}}::cbor::EncodeFromLatin1;
+using {{config.encoding_lib.namespace}}::cbor::EncodeFromUTF16;
+using {{config.encoding_lib.namespace}}::cbor::EncodeIndefiniteLengthArrayStart;
+using {{config.encoding_lib.namespace}}::cbor::EncodeIndefiniteLengthMapStart;
+using {{config.encoding_lib.namespace}}::cbor::EncodeInt32;
+using {{config.encoding_lib.namespace}}::cbor::EncodeNull;
+using {{config.encoding_lib.namespace}}::cbor::EncodeStop;
+using {{config.encoding_lib.namespace}}::cbor::EncodeString8;
+using {{config.encoding_lib.namespace}}::cbor::EncodeTrue;
+using {{config.encoding_lib.namespace}}::cbor::EnvelopeEncoder;
+using {{config.encoding_lib.namespace}}::cbor::InitialByteForEnvelope;
+} // namespace cbor
+
// Below are three parsing routines for CBOR, which cover enough
// to roundtrip JSON messages.
std::unique_ptr<DictionaryValue> parseMap(int32_t stack_depth, cbor::CBORTokenizer* tokenizer);
@@ -138,7 +162,7 @@ std::unique_ptr<Value> parseValue(
case cbor::CBORTokenTag::STRING16: {
span<uint8_t> wire = tokenizer->GetString16WireRep();
DCHECK_EQ(wire.size() & 1, 0u);
- std::unique_ptr<Value> value = StringValue::create(StringUtil::fromUTF16(
+ std::unique_ptr<Value> value = StringValue::create(StringUtil::fromUTF16LE(
reinterpret_cast<const uint16_t*>(wire.data()), wire.size() / 2));
tokenizer->Next();
return value;
@@ -180,7 +204,7 @@ std::unique_ptr<DictionaryValue> parseMap(
} else if (tokenizer->TokenTag() == cbor::CBORTokenTag::STRING16) {
span<uint8_t> key_span = tokenizer->GetString16WireRep();
if (key_span.size() & 1) return nullptr; // UTF16 is 2 byte multiple.
- key = StringUtil::fromUTF16(
+ key = StringUtil::fromUTF16LE(
reinterpret_cast<const uint16_t*>(key_span.data()),
key_span.size() / 2);
tokenizer->Next();