| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/local_discovery/privet_traffic_detector.h" | 5 #include "chrome/browser/local_discovery/privet_traffic_detector.h" |
| 6 | 6 |
| 7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
| 8 #include "base/sys_byteorder.h" | 8 #include "base/sys_byteorder.h" |
| 9 #include "net/base/dns_util.h" | 9 #include "net/base/dns_util.h" |
| 10 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 net::AddressFamily address_family = | 32 net::AddressFamily address_family = |
| 33 net::GetAddressFamily(networks[i].address); | 33 net::GetAddressFamily(networks[i].address); |
| 34 if (address_family == net::ADDRESS_FAMILY_IPV4 && | 34 if (address_family == net::ADDRESS_FAMILY_IPV4 && |
| 35 networks[i].network_prefix >= 24) { | 35 networks[i].network_prefix >= 24) { |
| 36 ip4_networks.push_back(networks[i]); | 36 ip4_networks.push_back(networks[i]); |
| 37 } | 37 } |
| 38 } | 38 } |
| 39 | 39 |
| 40 net::IPAddressNumber localhost_prefix(4, 0); | 40 net::IPAddressNumber localhost_prefix(4, 0); |
| 41 localhost_prefix[0] = 127; | 41 localhost_prefix[0] = 127; |
| 42 ip4_networks.push_back(net::NetworkInterface("lo", localhost_prefix, 8)); | 42 ip4_networks.push_back(net::NetworkInterface("lo", 0, localhost_prefix, 8)); |
| 43 content::BrowserThread::PostTask(content::BrowserThread::IO, FROM_HERE, | 43 content::BrowserThread::PostTask(content::BrowserThread::IO, FROM_HERE, |
| 44 base::Bind(callback, ip4_networks)); | 44 base::Bind(callback, ip4_networks)); |
| 45 } | 45 } |
| 46 | 46 |
| 47 } // namespace | 47 } // namespace |
| 48 | 48 |
| 49 namespace local_discovery { | 49 namespace local_discovery { |
| 50 | 50 |
| 51 PrivetTrafficDetector::PrivetTrafficDetector( | 51 PrivetTrafficDetector::PrivetTrafficDetector( |
| 52 net::AddressFamily address_family, | 52 net::AddressFamily address_family, |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 base::Unretained(this))); | 182 base::Unretained(this))); |
| 183 } while (rv > 0); | 183 } while (rv > 0); |
| 184 | 184 |
| 185 if (rv != net::ERR_IO_PENDING) | 185 if (rv != net::ERR_IO_PENDING) |
| 186 return rv; | 186 return rv; |
| 187 | 187 |
| 188 return net::OK; | 188 return net::OK; |
| 189 } | 189 } |
| 190 | 190 |
| 191 } // namespace local_discovery | 191 } // namespace local_discovery |
| OLD | NEW |