Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1299)

Unified Diff: runtime/bin/socket_patch.dart

Issue 95183002: Add the index information to network interface (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: runtime/bin/socket_patch.dart
diff --git a/runtime/bin/socket_patch.dart b/runtime/bin/socket_patch.dart
index 1480f1f97b41ef2331744cca1e9313d799dddfc4..83892412fc206fe0e98dda654add1cefb438768d 100644
--- a/runtime/bin/socket_patch.dart
+++ b/runtime/bin/socket_patch.dart
@@ -197,9 +197,10 @@ class _InternetAddress implements InternetAddress {
class _NetworkInterface implements NetworkInterface {
final String name;
- final List<InternetAddress> addresses;
+ final int index;
+ final List<InternetAddress> addresses = [];
- _NetworkInterface(String this.name, List<InternetAddress> this.addresses);
+ _NetworkInterface(this.name, this.index);
String toString() {
return "NetworkInterface('$name', $addresses)";
@@ -310,16 +311,18 @@ class _NativeSocket extends NativeFieldWrapperClass1 {
.fold(new Map<String, List<InternetAddress>>(), (map, result) {
var type = new InternetAddressType._from(result[0]);
var name = result[3];
+ var index = result[4];
var address = new _InternetAddress(
type, result[1], "", result[2]);
if (!includeLinkLocal && address.isLinkLocal) return map;
if (!includeLoopback && address.isLoopback) return map;
- map.putIfAbsent(name, () => new List<InternetAddress>());
- map[name].add(address);
+ map.putIfAbsent(
+ name, () => new _NetworkInterface(name, index));
+ map[name].addresses.add(address);
return map;
})
Anders Johnsen 2013/11/29 08:35:10 .values.toList();
Søren Gjesse 2013/11/29 10:01:20 Done.
- .forEach((name, addresses) {
- list.add(new _NetworkInterface(name, addresses));
+ .forEach((name, interface) {
+ list.add(interface);
});
return list;
}

Powered by Google App Engine
This is Rietveld 408576698