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

Unified Diff: sdk/lib/io/secure_socket.dart

Issue 14036017: Revert "Add new InternetAddress class with a static lookup function (including IPv6 results)." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 months 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 | « sdk/lib/io/http_impl.dart ('k') | sdk/lib/io/socket.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/secure_socket.dart
diff --git a/sdk/lib/io/secure_socket.dart b/sdk/lib/io/secure_socket.dart
index db82ea4d7b6137bc32ec15c47b7795ae5a2ae50a..17eb384021d326c3377082a3f1248bbdb901f39a 100644
--- a/sdk/lib/io/secure_socket.dart
+++ b/sdk/lib/io/secure_socket.dart
@@ -35,7 +35,7 @@ abstract class SecureSocket implements Socket {
* to continue the [SecureSocket] connection.
*/
static Future<SecureSocket> connect(
- host,
+ String host,
int port,
{bool sendClientCertificate: false,
String certificateName,
@@ -208,7 +208,7 @@ abstract class RawSecureSocket implements RawSocket {
* to continue the [RawSecureSocket] connection.
*/
static Future<RawSecureSocket> connect(
- host,
+ String host,
int port,
{bool sendClientCertificate: false,
String certificateName,
@@ -244,7 +244,7 @@ abstract class RawSecureSocket implements RawSocket {
String certificateName,
bool onBadCertificate(X509Certificate certificate)}) {
return _RawSecureSocket.connect(
- socket.address,
+ socket.host,
socket.port,
certificateName,
is_server: false,
@@ -345,7 +345,7 @@ class _RawSecureSocket extends Stream<RawSocketEvent>
StreamSubscription<RawSocketEvent> _socketSubscription;
List<int> _carryOverData;
int _carryOverDataIndex = 0;
- final InternetAddress address;
+ final String host;
final bool is_server;
final String certificateName;
final bool requestClientCertificate;
@@ -366,7 +366,7 @@ class _RawSecureSocket extends Stream<RawSocketEvent>
_SecureFilter _secureFilter = new _SecureFilter();
static Future<_RawSecureSocket> connect(
- host,
+ String host,
int requestedPort,
String certificateName,
{bool is_server,
@@ -376,15 +376,8 @@ class _RawSecureSocket extends Stream<RawSocketEvent>
bool requestClientCertificate: false,
bool requireClientCertificate: false,
bool sendClientCertificate: false,
- bool onBadCertificate(X509Certificate certificate)}) {
- var future;
- if (host is String) {
- future = InternetAddress.lookup(host).then((addrs) => addrs.first);
- } else {
- future = new Future.value(host);
- }
- return future.then((addr) {
- return new _RawSecureSocket(addr,
+ bool onBadCertificate(X509Certificate certificate)}){
+ return new _RawSecureSocket(host,
requestedPort,
certificateName,
is_server,
@@ -396,11 +389,10 @@ class _RawSecureSocket extends Stream<RawSocketEvent>
sendClientCertificate,
onBadCertificate)
._handshakeComplete.future;
- });
}
_RawSecureSocket(
- InternetAddress this.address,
+ String this.host,
int requestedPort,
String this.certificateName,
bool this.is_server,
@@ -429,7 +421,7 @@ class _RawSecureSocket extends Stream<RawSocketEvent>
}
var futureSocket;
if (socket == null) {
- futureSocket = RawSocket.connect(address, requestedPort);
+ futureSocket = RawSocket.connect(host, requestedPort);
} else {
futureSocket = new Future.value(socket);
}
@@ -449,7 +441,7 @@ class _RawSecureSocket extends Stream<RawSocketEvent>
_socketSubscription.onDone(_doneHandler);
}
_connectPending = true;
- _secureFilter.connect(rawSocket.address.host,
+ _secureFilter.connect(host,
port,
is_server,
certificateName,
@@ -483,9 +475,9 @@ class _RawSecureSocket extends Stream<RawSocketEvent>
void _verifyFields() {
assert(is_server is bool);
assert(_socket == null || _socket is RawSocket);
- if (address is! InternetAddress) {
+ if (host is! String) {
throw new ArgumentError(
- "RawSecureSocket constructor: host is not an InternetAddress");
+ "RawSecureSocket constructor: host is not a String");
}
if (certificateName != null && certificateName is! String) {
throw new ArgumentError("certificateName is not null or a String");
« no previous file with comments | « sdk/lib/io/http_impl.dart ('k') | sdk/lib/io/socket.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698