diff options
Diffstat (limited to 'deps/v8/third_party/inspector_protocol/lib/Values_h.template')
-rw-r--r-- | deps/v8/third_party/inspector_protocol/lib/Values_h.template | 55 |
1 files changed, 47 insertions, 8 deletions
diff --git a/deps/v8/third_party/inspector_protocol/lib/Values_h.template b/deps/v8/third_party/inspector_protocol/lib/Values_h.template index e8eb91d85a..4a2e58f4cd 100644 --- a/deps/v8/third_party/inspector_protocol/lib/Values_h.template +++ b/deps/v8/third_party/inspector_protocol/lib/Values_h.template @@ -1,3 +1,5 @@ +// This file is generated by Values_h.template. + // Copyright 2016 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -26,15 +28,19 @@ public: return std::unique_ptr<Value>(new Value()); } + static std::unique_ptr<Value> parseBinary(const uint8_t* data, size_t size); + enum ValueType { TypeNull = 0, TypeBoolean, TypeInteger, TypeDouble, TypeString, + TypeBinary, TypeObject, TypeArray, - TypeSerialized + TypeSerialized, + TypeImported }; ValueType type() const { return m_type; } @@ -45,11 +51,14 @@ public: virtual bool asDouble(double* output) const; virtual bool asInteger(int* output) const; virtual bool asString(String* output) const; - virtual bool asSerialized(String* output) const; + virtual bool asBinary(Binary* output) const; virtual void writeJSON(StringBuilder* output) const; + virtual void writeBinary(std::vector<uint8_t>* bytes) const; virtual std::unique_ptr<Value> clone() const; - String serialize() override; + String toJSONString() const; + String serializeToJSON() override; + std::vector<uint8_t> serializeToBinary() override; protected: Value() : m_type(TypeNull) { } @@ -83,6 +92,7 @@ public: bool asDouble(double* output) const override; bool asInteger(int* output) const override; void writeJSON(StringBuilder* output) const override; + void writeBinary(std::vector<uint8_t>* bytes) const override; std::unique_ptr<Value> clone() const override; private: @@ -111,6 +121,7 @@ public: bool asString(String* output) const override; void writeJSON(StringBuilder* output) const override; + void writeBinary(std::vector<uint8_t>* bytes) const override; std::unique_ptr<Value> clone() const override; private: @@ -120,21 +131,47 @@ private: String m_stringValue; }; +class {{config.lib.export_macro}} BinaryValue : public Value { +public: + static std::unique_ptr<BinaryValue> create(const Binary& value) + { + return std::unique_ptr<BinaryValue>(new BinaryValue(value)); + } + + bool asBinary(Binary* output) const override; + void writeJSON(StringBuilder* output) const override; + void writeBinary(std::vector<uint8_t>* bytes) const override; + std::unique_ptr<Value> clone() const override; + +private: + explicit BinaryValue(const Binary& value) : Value(TypeBinary), m_binaryValue(value) { } + + Binary m_binaryValue; +}; + class {{config.lib.export_macro}} SerializedValue : public Value { public: - static std::unique_ptr<SerializedValue> create(const String& value) + static std::unique_ptr<SerializedValue> fromJSON(const String& value) { return std::unique_ptr<SerializedValue>(new SerializedValue(value)); } - bool asSerialized(String* output) const override; + static std::unique_ptr<SerializedValue> fromBinary(std::vector<uint8_t> value) + { + return std::unique_ptr<SerializedValue>(new SerializedValue(std::move(value))); + } + void writeJSON(StringBuilder* output) const override; + void writeBinary(std::vector<uint8_t>* bytes) const override; std::unique_ptr<Value> clone() const override; private: - explicit SerializedValue(const String& value) : Value(TypeSerialized), m_serializedValue(value) { } - - String m_serializedValue; + explicit SerializedValue(const String& json) : Value(TypeSerialized), m_serializedJSON(json) { } + explicit SerializedValue(std::vector<uint8_t> binary) : Value(TypeSerialized), m_serializedBinary(std::move(binary)) { } + SerializedValue(const String& json, const std::vector<uint8_t>& binary) + : Value(TypeSerialized), m_serializedJSON(json), m_serializedBinary(binary) { } + String m_serializedJSON; + std::vector<uint8_t> m_serializedBinary; }; class {{config.lib.export_macro}} DictionaryValue : public Value { @@ -158,6 +195,7 @@ public: } void writeJSON(StringBuilder* output) const override; + void writeBinary(std::vector<uint8_t>* bytes) const override; std::unique_ptr<Value> clone() const override; size_t size() const { return m_data.size(); } @@ -226,6 +264,7 @@ public: ~ListValue() override; void writeJSON(StringBuilder* output) const override; + void writeBinary(std::vector<uint8_t>* bytes) const override; std::unique_ptr<Value> clone() const override; void pushValue(std::unique_ptr<Value>); |