#include "services/network/public/cpp/transferable_socket_mojom_traits.h"
#include <algorithm>
#include <vector>
#include "base/dcheck_is_on.h"
#include "build/build_config.h"
#include "mojo/public/cpp/bindings/struct_traits.h"
namespace mojo {
#if BUILDFLAG(IS_WIN)
const std::vector<uint8_t>&
StructTraits<network::mojom::TransferableSocketDataView,
network::TransferableSocket>::
protocol_info(const network::TransferableSocket& value) {
#if DCHECK_IS_ON()
DCHECK(!value.has_been_transferred_) << "Can only transfer once.";
#endif
return value.wsa_info_buffer_;
}
#else
mojo::PlatformHandle StructTraits<
network::mojom::TransferableSocketDataView,
network::TransferableSocket>::socket(network::TransferableSocket& value) { … }
#endif
bool StructTraits<network::mojom::TransferableSocketDataView,
network::TransferableSocket>::
Read(network::mojom::TransferableSocketDataView in,
network::TransferableSocket* out) { … }
}