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

Side by Side Diff: runtime/bin/http_impl.dart

Issue 10164001: Unregister callbacks from socket, when we return the socket for reuse. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 class _HttpHeaders implements HttpHeaders { 5 class _HttpHeaders implements HttpHeaders {
6 _HttpHeaders() : _headers = new Map<String, List<String>>(); 6 _HttpHeaders() : _headers = new Map<String, List<String>>();
7 7
8 List<String> operator[](String name) { 8 List<String> operator[](String name) {
9 name = name.toLowerCase(); 9 name = name.toLowerCase();
10 return _headers[name]; 10 return _headers[name];
(...skipping 1093 matching lines...) Expand 10 before | Expand all | Expand 10 after
1104 // Tell the HTTP parser the method it is expecting a response to. 1104 // Tell the HTTP parser the method it is expecting a response to.
1105 _httpParser.responseToMethod = _method; 1105 _httpParser.responseToMethod = _method;
1106 } 1106 }
1107 1107
1108 void _responseDone() { 1108 void _responseDone() {
1109 if (_closing) { 1109 if (_closing) {
1110 if (_socket != null) { 1110 if (_socket != null) {
1111 _socket.close(); 1111 _socket.close();
1112 } 1112 }
1113 } else { 1113 } else {
1114 _socket.onData = null;
Søren Gjesse 2012/04/20 11:07:22 _returnSocketConnection already does this (calls _
Anders Johnsen 2012/04/20 11:13:42 It's done iff shutdown is not marked. Is there a o
Søren Gjesse 2012/04/20 11:27:35 How about just moving the _markReturned to the top
1115 _socket.onClosed = null;
1116 _socket.onError = null;
1114 _client._returnSocketConnection(_socketConn); 1117 _client._returnSocketConnection(_socketConn);
1115 } 1118 }
1116 _socket = null; 1119 _socket = null;
1117 _socketConn = null; 1120 _socketConn = null;
1118 } 1121 }
1119 1122
1120 HttpClientRequest open(String method, String uri) { 1123 HttpClientRequest open(String method, String uri) {
1121 _method = method; 1124 _method = method;
1122 _request = new _HttpClientRequest(method, uri, this); 1125 _request = new _HttpClientRequest(method, uri, this);
1123 _response = new _HttpClientResponse(this); 1126 _response = new _HttpClientResponse(this);
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
1390 sockets.addFirst(socketConn); 1393 sockets.addFirst(socketConn);
1391 socketConn._markReturned(); 1394 socketConn._markReturned();
1392 } 1395 }
1393 1396
1394 Function _onOpen; 1397 Function _onOpen;
1395 Map<String, Queue<_SocketConnection>> _openSockets; 1398 Map<String, Queue<_SocketConnection>> _openSockets;
1396 Set<_SocketConnection> _activeSockets; 1399 Set<_SocketConnection> _activeSockets;
1397 Timer _evictionTimer; 1400 Timer _evictionTimer;
1398 bool _shutdown; // Has this HTTP client been shutdown? 1401 bool _shutdown; // Has this HTTP client been shutdown?
1399 } 1402 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698