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

Unified Diff: runtime/bin/service_object_patch.dart

Issue 297213005: Add Socket ref to HttpServer. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Deploy 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/bin/socket_patch.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/service_object_patch.dart
diff --git a/runtime/bin/service_object_patch.dart b/runtime/bin/service_object_patch.dart
index 2a0669419a4a9c5260015cf3f9b701278f3821d7..a7e104e61a0eafb8484a8b372295891dfac4b52f 100644
--- a/runtime/bin/service_object_patch.dart
+++ b/runtime/bin/service_object_patch.dart
@@ -5,8 +5,9 @@
final Map _servicePathMap = {
'http' : {
- 'servers' : _httpServersServiceObject
+ 'servers' : _httpServersServiceObject,
},
+ 'socket' : _socketServiceObject,
'file' : {
'randomaccessfiles' : _randomAccessFilesServiceObject
}
@@ -63,6 +64,22 @@ Map _httpServersServiceObject(args) {
};
}
+Map _socketServiceObject(args) {
+ if (args.length == 1) {
+ var socket = _NativeSocket._sockets[int.parse(args.first)];
+ if (socket == null) {
+ return {};
+ }
+ return socket._toJSON(false);
+ }
+ return {
+ 'id': 'io/socket',
+ 'type': 'SocketList',
+ 'members': _NativeSocket._sockets.values
+ .map((socket) => socket._toJSON(true)).toList(),
+ };
+}
+
Map _randomAccessFilesServiceObject(args) {
if (args.length == 1) {
var raf = _RandomAccessFile._files[int.parse(args.first)];
« no previous file with comments | « no previous file | runtime/bin/socket_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698