OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "content/renderer/p2p/ipc_network_manager.h" | 5 #include "content/renderer/p2p/ipc_network_manager.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "net/base/net_util.h" | 8 #include "net/base/net_util.h" |
9 #include "net/base/sys_byteorder.h" | 9 #include "net/base/sys_byteorder.h" |
10 | 10 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 | 46 |
47 std::vector<talk_base::Network*> networks; | 47 std::vector<talk_base::Network*> networks; |
48 for (net::NetworkInterfaceList::const_iterator it = list.begin(); | 48 for (net::NetworkInterfaceList::const_iterator it = list.begin(); |
49 it != list.end(); it++) { | 49 it != list.end(); it++) { |
50 uint32 address; | 50 uint32 address; |
51 if (it->address.size() != net::kIPv4AddressSize) | 51 if (it->address.size() != net::kIPv4AddressSize) |
52 continue; | 52 continue; |
53 memcpy(&address, &it->address[0], sizeof(uint32)); | 53 memcpy(&address, &it->address[0], sizeof(uint32)); |
54 address = ntohl(address); | 54 address = ntohl(address); |
55 networks.push_back( | 55 networks.push_back( |
56 new talk_base::Network(it->name, it->name, address, 0)); | 56 new talk_base::Network(it->name, it->name, address)); |
57 } | 57 } |
58 | 58 |
59 MergeNetworkList(networks, !first_update_sent_); | 59 MergeNetworkList(networks, !first_update_sent_); |
60 first_update_sent_ = false; | 60 first_update_sent_ = false; |
61 } | 61 } |
62 | 62 |
63 void IpcNetworkManager::SendNetworksChangedSignal() { | 63 void IpcNetworkManager::SendNetworksChangedSignal() { |
64 SignalNetworksChanged(); | 64 SignalNetworksChanged(); |
65 } | 65 } |
66 | 66 |
67 } // namespace content | 67 } // namespace content |
OLD | NEW |