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

Side by Side Diff: sdk/lib/io/websocket_impl.dart

Issue 304513004: Add 'owner' field to sockets, that point to a potential IO resource using that Socket. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix. Created 6 years, 7 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 | « sdk/lib/io/secure_server_socket.dart ('k') | 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 part of dart.io; 5 part of dart.io;
6 6
7 const String _webSocketGUID = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"; 7 const String _webSocketGUID = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11";
8 8
9 // Matches _WebSocketOpcode. 9 // Matches _WebSocketOpcode.
10 class _WebSocketMessageType { 10 class _WebSocketMessageType {
(...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after
890 _controller.close(); 890 _controller.close();
891 }, 891 },
892 cancelOnError: true); 892 cancelOnError: true);
893 _subscription.pause(); 893 _subscription.pause();
894 _controller = new StreamController(sync: true, 894 _controller = new StreamController(sync: true,
895 onListen: _subscription.resume, 895 onListen: _subscription.resume,
896 onPause: _subscription.pause, 896 onPause: _subscription.pause,
897 onResume: _subscription.resume); 897 onResume: _subscription.resume);
898 898
899 _webSockets[_serviceId] = this; 899 _webSockets[_serviceId] = this;
900 try { _socket._owner = this; } catch (_) {}
900 } 901 }
901 902
902 StreamSubscription listen(void onData(message), 903 StreamSubscription listen(void onData(message),
903 {Function onError, 904 {Function onError,
904 void onDone(), 905 void onDone(),
905 bool cancelOnError}) { 906 bool cancelOnError}) {
906 return _controller.stream.listen(onData, 907 return _controller.stream.listen(onData,
907 onError: onError, 908 onError: onError,
908 onDone: onDone, 909 onDone: onDone,
909 cancelOnError: cancelOnError); 910 cancelOnError: cancelOnError);
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
1005 (code < WebSocketStatus.NORMAL_CLOSURE || 1006 (code < WebSocketStatus.NORMAL_CLOSURE ||
1006 code == WebSocketStatus.RESERVED_1004 || 1007 code == WebSocketStatus.RESERVED_1004 ||
1007 code == WebSocketStatus.NO_STATUS_RECEIVED || 1008 code == WebSocketStatus.NO_STATUS_RECEIVED ||
1008 code == WebSocketStatus.ABNORMAL_CLOSURE || 1009 code == WebSocketStatus.ABNORMAL_CLOSURE ||
1009 (code > WebSocketStatus.INTERNAL_SERVER_ERROR && 1010 (code > WebSocketStatus.INTERNAL_SERVER_ERROR &&
1010 code < WebSocketStatus.RESERVED_1015) || 1011 code < WebSocketStatus.RESERVED_1015) ||
1011 (code >= WebSocketStatus.RESERVED_1015 && 1012 (code >= WebSocketStatus.RESERVED_1015 &&
1012 code < 3000)); 1013 code < 3000));
1013 } 1014 }
1014 } 1015 }
OLDNEW
« no previous file with comments | « sdk/lib/io/secure_server_socket.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698