OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/sys_byteorder.h" | 8 #include "base/sys_byteorder.h" |
9 #include "net/base/net_util.h" | 9 #include "net/base/net_util.h" |
10 | 10 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 uint32 address; | 51 uint32 address; |
52 if (it->address.size() != net::kIPv4AddressSize) | 52 if (it->address.size() != net::kIPv4AddressSize) |
53 continue; | 53 continue; |
54 memcpy(&address, &it->address[0], sizeof(uint32)); | 54 memcpy(&address, &it->address[0], sizeof(uint32)); |
55 address = ntohl(address); | 55 address = ntohl(address); |
56 networks.push_back( | 56 networks.push_back( |
57 new talk_base::Network( | 57 new talk_base::Network( |
58 it->name, it->name, talk_base::IPAddress(address))); | 58 it->name, it->name, talk_base::IPAddress(address))); |
59 } | 59 } |
60 | 60 |
61 MergeNetworkList(networks); | 61 bool changed = false; |
| 62 MergeNetworkList(networks, &changed); |
| 63 if (changed) |
| 64 SignalNetworksChanged(); |
62 } | 65 } |
63 | 66 |
64 void IpcNetworkManager::SendNetworksChangedSignal() { | 67 void IpcNetworkManager::SendNetworksChangedSignal() { |
65 SignalNetworksChanged(); | 68 SignalNetworksChanged(); |
66 } | 69 } |
67 | 70 |
68 } // namespace content | 71 } // namespace content |
OLD | NEW |