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

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

Issue 293363007: Add 'Sockets' to observatory. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Deploy Created 6 years, 6 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 | runtime/bin/socket_patch.dart » ('j') | 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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 5
6 final Map _servicePathMap = { 6 final Map _servicePathMap = {
7 'http' : { 7 'http' : {
8 'servers' : _httpServersServiceObject, 8 'servers' : _httpServersServiceObject,
9 }, 9 },
10 'socket' : _socketServiceObject, 10 'sockets' : _socketsServiceObject,
11 'file' : { 11 'file' : {
12 'randomaccessfiles' : _randomAccessFilesServiceObject 12 'randomaccessfiles' : _randomAccessFilesServiceObject
13 } 13 }
14 }; 14 };
15 15
16 String _serviceObjectHandler(List<String> paths, 16 String _serviceObjectHandler(List<String> paths,
17 List<String> keys, 17 List<String> keys,
18 List<String> values) { 18 List<String> values) {
19 assert(keys.length == values.length); 19 assert(keys.length == values.length);
20 badPath() { 20 badPath() {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 return server._toJSON(false); 57 return server._toJSON(false);
58 } 58 }
59 return { 59 return {
60 'id': 'io/http/servers', 60 'id': 'io/http/servers',
61 'type': 'HttpServerList', 61 'type': 'HttpServerList',
62 'members': _HttpServer._servers.values 62 'members': _HttpServer._servers.values
63 .map((server) => server._toJSON(true)).toList(), 63 .map((server) => server._toJSON(true)).toList(),
64 }; 64 };
65 } 65 }
66 66
67 Map _socketServiceObject(args) { 67 Map _socketsServiceObject(args) {
68 if (args.length == 1) { 68 if (args.length == 1) {
69 var socket = _NativeSocket._sockets[int.parse(args.first)]; 69 var socket = _NativeSocket._sockets[int.parse(args.first)];
70 if (socket == null) { 70 if (socket == null) {
71 return {}; 71 return {};
72 } 72 }
73 return socket._toJSON(false); 73 return socket._toJSON(false);
74 } 74 }
75 return { 75 return {
76 'id': 'io/socket', 76 'id': 'io/sockets',
77 'type': 'SocketList', 77 'type': 'SocketList',
78 'members': _NativeSocket._sockets.values 78 'members': _NativeSocket._sockets.values
79 .map((socket) => socket._toJSON(true)).toList(), 79 .map((socket) => socket._toJSON(true)).toList(),
80 }; 80 };
81 } 81 }
82 82
83 Map _randomAccessFilesServiceObject(args) { 83 Map _randomAccessFilesServiceObject(args) {
84 if (args.length == 1) { 84 if (args.length == 1) {
85 var raf = _RandomAccessFile._files[int.parse(args.first)]; 85 var raf = _RandomAccessFile._files[int.parse(args.first)];
86 if (raf == null) { 86 if (raf == null) {
87 return {}; 87 return {};
88 } 88 }
89 return raf._toJSON(false); 89 return raf._toJSON(false);
90 } 90 }
91 return { 91 return {
92 'id': 'io/file/randomaccessfiles', 92 'id': 'io/file/randomaccessfiles',
93 'type': 'RandomAccessFileList', 93 'type': 'RandomAccessFileList',
94 'members': _RandomAccessFile._files.values 94 'members': _RandomAccessFile._files.values
95 .map((raf) => raf._toJSON(true)).toList(), 95 .map((raf) => raf._toJSON(true)).toList(),
96 }; 96 };
97 } 97 }
98 98
OLDNEW
« 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