OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/dns/mojo_host_struct_traits.h" | 5 #include "net/dns/mojo_host_struct_traits.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "net/base/address_list.h" | 10 #include "net/base/address_list.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 } | 69 } |
70 | 70 |
71 // static | 71 // static |
72 bool StructTraits<net::interfaces::IPEndPointDataView, net::IPEndPoint>::Read( | 72 bool StructTraits<net::interfaces::IPEndPointDataView, net::IPEndPoint>::Read( |
73 net::interfaces::IPEndPointDataView data, | 73 net::interfaces::IPEndPointDataView data, |
74 net::IPEndPoint* out) { | 74 net::IPEndPoint* out) { |
75 std::vector<uint8_t> bytes; | 75 std::vector<uint8_t> bytes; |
76 if (!data.ReadAddress(&bytes)) | 76 if (!data.ReadAddress(&bytes)) |
77 return false; | 77 return false; |
78 | 78 |
79 *out = net::IPEndPoint(net::IPAddress(bytes), data.port()); | 79 *out = |
| 80 net::IPEndPoint(net::IPAddress(bytes.data(), bytes.size()), data.port()); |
80 return true; | 81 return true; |
81 } | 82 } |
82 | 83 |
83 // static | 84 // static |
84 bool StructTraits<net::interfaces::AddressListDataView, net::AddressList>::Read( | 85 bool StructTraits<net::interfaces::AddressListDataView, net::AddressList>::Read( |
85 net::interfaces::AddressListDataView data, | 86 net::interfaces::AddressListDataView data, |
86 net::AddressList* out) { | 87 net::AddressList* out) { |
87 return data.ReadAddresses(&out->endpoints()); | 88 return data.ReadAddresses(&out->endpoints()); |
88 } | 89 } |
89 | 90 |
90 } // namespace mojo | 91 } // namespace mojo |
OLD | NEW |