OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "net/interfaces/ip_address_struct_traits.h" | |
6 | |
7 namespace mojo { | |
8 // static | |
9 bool StructTraits<net::interfaces::IPAddressDataView, net::IPAddress>::Read( | |
10 net::interfaces::IPAddressDataView data, | |
11 net::IPAddress* out) { | |
12 std::vector<uint8_t> bytes; | |
13 if (!data.ReadAddress(&bytes)) | |
14 return false; | |
15 | |
16 *out = net::IPAddress(bytes); | |
17 return true; | |
dcheng
2017/03/09 22:11:35
Should we check out->IsValid() here?
zhaobin
2017/03/09 22:21:05
Done.
| |
18 } | |
19 | |
20 } // namespace mojo | |
OLD | NEW |