blob: 9c7b48e0d4997f0fb093aaaffa4ed41537d8343f [file] [log] [blame]
// Copyright 2017 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.
#include "mojo/public/cpp/bindings/struct_traits.h"
#include "net/base/ip_address.h"
#include "net/interfaces/ip_address.mojom.h"
namespace mojo {
template <>
struct StructTraits<net::interfaces::IPAddressDataView, net::IPAddress> {
static const std::vector<uint8_t> address(const net::IPAddress& ip_address) {
// TODO(rch): avoid creating a vector here.
return ip_address.CopyBytesToVector();
static bool Read(net::interfaces::IPAddressDataView obj, net::IPAddress* out);
} // namespace mojo