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

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

Issue 300043011: Add WebSockets 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 'sockets' : _socketsServiceObject, 10 'sockets' : _socketsServiceObject,
11 'websockets' : _webSocketsServiceObject,
11 'file' : { 12 'file' : {
12 'randomaccessfiles' : _randomAccessFilesServiceObject 13 'randomaccessfiles' : _randomAccessFilesServiceObject
13 }, 14 },
14 'processes' : _processesServiceObject, 15 'processes' : _processesServiceObject,
15 }; 16 };
16 17
17 String _serviceObjectHandler(List<String> paths, 18 String _serviceObjectHandler(List<String> paths,
18 List<String> keys, 19 List<String> keys,
19 List<String> values) { 20 List<String> values) {
20 assert(keys.length == values.length); 21 assert(keys.length == values.length);
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 return socket._toJSON(false); 75 return socket._toJSON(false);
75 } 76 }
76 return { 77 return {
77 'id': 'io/sockets', 78 'id': 'io/sockets',
78 'type': 'SocketList', 79 'type': 'SocketList',
79 'members': _NativeSocket._sockets.values 80 'members': _NativeSocket._sockets.values
80 .map((socket) => socket._toJSON(true)).toList(), 81 .map((socket) => socket._toJSON(true)).toList(),
81 }; 82 };
82 } 83 }
83 84
85 Map _webSocketsServiceObject(args) {
86 if (args.length == 1) {
87 var webSocket = _WebSocketImpl._webSockets[int.parse(args.first)];
88 if (webSocket == null) {
89 return {};
90 }
91 return webSocket._toJSON(false);
92 }
93 return {
94 'id': 'io/websockets',
95 'type': 'WebSocketList',
96 'members': _WebSocketImpl._webSockets.values
97 .map((webSocket) => webSocket._toJSON(true)).toList(),
98 };
99 }
100
84 Map _randomAccessFilesServiceObject(args) { 101 Map _randomAccessFilesServiceObject(args) {
85 if (args.length == 1) { 102 if (args.length == 1) {
86 var raf = _RandomAccessFile._files[int.parse(args.first)]; 103 var raf = _RandomAccessFile._files[int.parse(args.first)];
87 if (raf == null) { 104 if (raf == null) {
88 return {}; 105 return {};
89 } 106 }
90 return raf._toJSON(false); 107 return raf._toJSON(false);
91 } 108 }
92 return { 109 return {
93 'id': 'io/file/randomaccessfiles', 110 'id': 'io/file/randomaccessfiles',
(...skipping 11 matching lines...) Expand all
105 } 122 }
106 return process._toJSON(false); 123 return process._toJSON(false);
107 } 124 }
108 return { 125 return {
109 'id': 'io/processes', 126 'id': 'io/processes',
110 'type': 'ProcessList', 127 'type': 'ProcessList',
111 'members': _ProcessImpl._processes.values 128 'members': _ProcessImpl._processes.values
112 .map((p) => p._toJSON(true)).toList(), 129 .map((p) => p._toJSON(true)).toList(),
113 }; 130 };
114 } 131 }
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