#include "third_party/inspector_protocol/crdtp/chromium/protocol_traits.h"
#include <string_view>
#include <utility>
#include "base/base64.h"
#include "base/memory/ptr_util.h"
#include "base/notreached.h"
#include "base/strings/utf_string_conversions.h"
#include "third_party/inspector_protocol/crdtp/cbor.h"
namespace crdtp {
Binary::Binary() : … { … }
Binary::Binary(const Binary& binary) : … { … }
Binary::Binary(scoped_refptr<base::RefCountedMemory> bytes) : … { … }
Binary::~Binary() = default;
void Binary::AppendSerialized(std::vector<uint8_t>* out) const { … }
std::string Binary::toBase64() const { … }
Binary Binary::fromBase64(std::string_view base64, bool* success) { … }
Binary Binary::fromRefCounted(scoped_refptr<base::RefCountedMemory> memory) { … }
Binary Binary::fromVector(std::vector<uint8_t> data) { … }
Binary Binary::fromString(std::string data) { … }
Binary Binary::fromSpan(const uint8_t* data, size_t size) { … }
bool ProtocolTypeTraits<Binary>::Deserialize(DeserializerState* state,
Binary* value) { … }
void ProtocolTypeTraits<Binary>::Serialize(const Binary& value,
std::vector<uint8_t>* bytes) { … }
bool ProtocolTypeTraits<std::string>::Deserialize(DeserializerState* state,
std::string* value) { … }
namespace {
template <typename Iterable>
void SerializeDict(const Iterable& iterable, std::vector<uint8_t>* bytes) { … }
bool DeserializeDict(DeserializerState* state, base::Value::Dict* dict) { … }
}
void ProtocolTypeTraits<std::string>::Serialize(const std::string& str,
std::vector<uint8_t>* bytes) { … }
bool ProtocolTypeTraits<base::Value>::Deserialize(DeserializerState* state,
base::Value* value) { … }
void ProtocolTypeTraits<base::Value>::Serialize(const base::Value& value,
std::vector<uint8_t>* bytes) { … }
bool ProtocolTypeTraits<traits::DictionaryValue>::Deserialize(
DeserializerState* state,
traits::DictionaryValue* value) { … }
void ProtocolTypeTraits<traits::DictionaryValue>::Serialize(
const traits::DictionaryValue& value,
std::vector<uint8_t>* bytes) { … }
bool ProtocolTypeTraits<traits::ListValue>::Deserialize(
DeserializerState* state,
traits::ListValue* value) { … }
void ProtocolTypeTraits<traits::ListValue>::Serialize(
const traits::ListValue& value,
std::vector<uint8_t>* bytes) { … }
}