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

Unified Diff: runtime/bin/socket_patch.dart

Issue 76243002: Don't supply host names for the fixed internet addresses (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated after offline discussion 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
« no previous file with comments | « no previous file | sdk/lib/io/socket.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/socket_patch.dart
diff --git a/runtime/bin/socket_patch.dart b/runtime/bin/socket_patch.dart
index fb93b8bce9beaca95bae8657d9608e2ac5c206cd..a4b9c83d35f4bcede943aab52551d58e6ad447b7 100644
--- a/runtime/bin/socket_patch.dart
+++ b/runtime/bin/socket_patch.dart
@@ -73,9 +73,11 @@ class _InternetAddress implements InternetAddress {
final InternetAddressType type;
final String address;
- final String host;
+ final String _host;
final Uint8List _sockaddr_storage;
+ String get host => _host != null ? _host : address;
+
bool get isLoopback {
switch (type) {
case InternetAddressType.IP_V4:
@@ -108,7 +110,7 @@ class _InternetAddress implements InternetAddress {
_InternetAddress(InternetAddressType this.type,
String this.address,
- String this.host,
+ String this._host,
List<int> this._sockaddr_storage);
factory _InternetAddress.fixed(int id) {
@@ -116,10 +118,10 @@ class _InternetAddress implements InternetAddress {
switch (id) {
case _ADDRESS_LOOPBACK_IP_V4:
return new _InternetAddress(
- InternetAddressType.IP_V4, "127.0.0.1", "localhost", sockaddr);
+ InternetAddressType.IP_V4, "127.0.0.1", null, sockaddr);
case _ADDRESS_LOOPBACK_IP_V6:
return new _InternetAddress(
- InternetAddressType.IP_V6, "::1", "ip6-localhost", sockaddr);
+ InternetAddressType.IP_V6, "::1", null, sockaddr);
case _ADDRESS_ANY_IP_V4:
return new _InternetAddress(
InternetAddressType.IP_V4, "0.0.0.0", "0.0.0.0", sockaddr);
@@ -443,7 +445,7 @@ class _NativeSocket extends NativeFieldWrapperClass1 {
InternetAddress get remoteAddress {
var result = nativeGetRemotePeer()[0];
var type = new InternetAddressType._from(result[0]);
- return new _InternetAddress(type, result[1], "", result[2]);
+ return new _InternetAddress(type, result[1], null, result[2]);
}
// Multiplexes socket events to the socket handlers.
« no previous file with comments | « no previous file | sdk/lib/io/socket.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698