chromium/third_party/inspector_protocol/crdtp/chromium/protocol_traits.cc

// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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 {}

// static
Binary Binary::fromBase64(std::string_view base64, bool* success) {}

// static
Binary Binary::fromRefCounted(scoped_refptr<base::RefCountedMemory> memory) {}

// static
Binary Binary::fromVector(std::vector<uint8_t> data) {}

// static
Binary Binary::fromString(std::string data) {}

// static
Binary Binary::fromSpan(const uint8_t* data, size_t size) {}

// static
bool ProtocolTypeTraits<Binary>::Deserialize(DeserializerState* state,
                                             Binary* value) {}

void ProtocolTypeTraits<Binary>::Serialize(const Binary& value,
                                           std::vector<uint8_t>* bytes) {}

// static
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) {}

}  // namespace

// static
void ProtocolTypeTraits<std::string>::Serialize(const std::string& str,
                                                std::vector<uint8_t>* bytes) {}

// static
bool ProtocolTypeTraits<base::Value>::Deserialize(DeserializerState* state,
                                                  base::Value* value) {}

// static
void ProtocolTypeTraits<base::Value>::Serialize(const base::Value& value,
                                                std::vector<uint8_t>* bytes) {}

// static
bool ProtocolTypeTraits<traits::DictionaryValue>::Deserialize(
    DeserializerState* state,
    traits::DictionaryValue* value) {}

// static
void ProtocolTypeTraits<traits::DictionaryValue>::Serialize(
    const traits::DictionaryValue& value,
    std::vector<uint8_t>* bytes) {}

// static
bool ProtocolTypeTraits<traits::ListValue>::Deserialize(
    DeserializerState* state,
    traits::ListValue* value) {}

void ProtocolTypeTraits<traits::ListValue>::Serialize(
    const traits::ListValue& value,
    std::vector<uint8_t>* bytes) {}

}  // namespace crdtp