Chromium Code Reviews| Index: runtime/bin/http_impl.dart |
| diff --git a/runtime/bin/http_impl.dart b/runtime/bin/http_impl.dart |
| index ef590d78287710c3954d4b63c05ce7799676cc8f..417d068c7e5313321ee6db2519decb263a003688 100644 |
| --- a/runtime/bin/http_impl.dart |
| +++ b/runtime/bin/http_impl.dart |
| @@ -707,6 +707,10 @@ class _HttpRequestResponseBase { |
| _bodyBytesWritten += bytes; |
| } |
| + HttpConnectionInfo get connectionInfo() { |
|
Bill Hesse
2012/07/19 15:05:10
Why not => notation here?
|
| + return _httpConnection.connectionInfo(); |
| + } |
| + |
| int _state; |
| bool _headResponse; |
| @@ -1241,6 +1245,18 @@ class _HttpConnectionBase implements Hashable { |
| return new _DetachedSocket(socket, _httpParser.unparsedData); |
| } |
| + HttpConnectionInfo get connectionInfo() { |
| + if (_socket == null || _closing || _error) return null; |
| + try { |
| + HttpConnectionInfo info = new _HttpConnectionInfo(); |
| + info.remoteHost = _socket.remoteHost; |
|
Bill Hesse
2012/07/19 15:05:10
Why not have a constructor
_HttpConnectionInfo(thi
Anders Johnsen
2012/07/19 15:12:44
_HttpConnectionInfo is a simple data container. Us
|
| + info.remotePort = _socket.remotePort; |
| + info.localPort = _socket.port; |
| + return info; |
| + } catch (var e) { } |
| + return null; |
| + } |
| + |
| abstract void _onConnectionClosed(e); |
| abstract void _responseDone(); |
| @@ -2100,6 +2116,13 @@ class _HttpClient implements HttpClient { |
| } |
| +class _HttpConnectionInfo implements HttpConnectionInfo { |
| + String remoteHost; |
| + String remotePort; |
| + String localPort; |
| +} |
| + |
| + |
| class _DetachedSocket implements DetachedSocket { |
| _DetachedSocket(this._socket, this._unparsedData); |
| Socket get socket() => _socket; |