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

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: 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') | sdk/lib/io/websocket_impl.dart » ('J')
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 }; 15 };
15 16
16 String _serviceObjectHandler(List<String> paths, 17 String _serviceObjectHandler(List<String> paths,
17 List<String> keys, 18 List<String> keys,
18 List<String> values) { 19 List<String> values) {
19 assert(keys.length == values.length); 20 assert(keys.length == values.length);
20 badPath() { 21 badPath() {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 return socket._toJSON(false); 74 return socket._toJSON(false);
74 } 75 }
75 return { 76 return {
76 'id': 'io/sockets', 77 'id': 'io/sockets',
77 'type': 'SocketList', 78 'type': 'SocketList',
78 'members': _NativeSocket._sockets.values 79 'members': _NativeSocket._sockets.values
79 .map((socket) => socket._toJSON(true)).toList(), 80 .map((socket) => socket._toJSON(true)).toList(),
80 }; 81 };
81 } 82 }
82 83
84 Map _webSocketsServiceObject(args) {
85 if (args.length == 1) {
86 var webSocket = _WebSocketImpl._webSockets[int.parse(args.first)];
87 if (webSocket == null) {
88 return {};
89 }
90 return webSocket._toJSON(false);
91 }
92 return {
93 'id': 'io/websockets',
94 'type': 'WebSocketList',
95 'members': _WebSocketImpl._webSockets.values
96 .map((webSocket) => webSocket._toJSON(true)).toList(),
97 };
98 }
99
83 Map _randomAccessFilesServiceObject(args) { 100 Map _randomAccessFilesServiceObject(args) {
84 if (args.length == 1) { 101 if (args.length == 1) {
85 var raf = _RandomAccessFile._files[int.parse(args.first)]; 102 var raf = _RandomAccessFile._files[int.parse(args.first)];
86 if (raf == null) { 103 if (raf == null) {
87 return {}; 104 return {};
88 } 105 }
89 return raf._toJSON(false); 106 return raf._toJSON(false);
90 } 107 }
91 return { 108 return {
92 'id': 'io/file/randomaccessfiles', 109 'id': 'io/file/randomaccessfiles',
93 'type': 'RandomAccessFileList', 110 'type': 'RandomAccessFileList',
94 'members': _RandomAccessFile._files.values 111 'members': _RandomAccessFile._files.values
95 .map((raf) => raf._toJSON(true)).toList(), 112 .map((raf) => raf._toJSON(true)).toList(),
96 }; 113 };
97 } 114 }
98 115
OLDNEW
« no previous file with comments | « no previous file | runtime/bin/socket_patch.dart » ('j') | sdk/lib/io/websocket_impl.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698