| OLD | NEW |
| 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 'websockets' : _webSocketsServiceObject, |
| 12 'file' : { | 12 'file' : { |
| 13 'randomaccessfiles' : _randomAccessFilesServiceObject | 13 'randomaccessfiles' : _randomAccessFilesServiceObject |
| 14 }, | 14 }, |
| 15 'processes' : _processesServiceObject, | 15 'processes' : _processesServiceObject, |
| 16 }; | 16 }; |
| 17 | 17 |
| 18 String _getServicePath(obj) => obj._servicePath; |
| 19 |
| 18 String _serviceObjectHandler(List<String> paths, | 20 String _serviceObjectHandler(List<String> paths, |
| 19 List<String> keys, | 21 List<String> keys, |
| 20 List<String> values) { | 22 List<String> values) { |
| 21 assert(keys.length == values.length); | 23 assert(keys.length == values.length); |
| 22 if (paths.isEmpty) { | 24 if (paths.isEmpty) { |
| 23 return JSON.encode(_ioServiceObject()); | 25 return JSON.encode(_ioServiceObject()); |
| 24 } | 26 } |
| 25 int i = 0; | 27 int i = 0; |
| 26 var current = _servicePathMap; | 28 var current = _servicePathMap; |
| 27 do { | 29 do { |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 } | 143 } |
| 142 return process._toJSON(false); | 144 return process._toJSON(false); |
| 143 } | 145 } |
| 144 return { | 146 return { |
| 145 'id': 'io/processes', | 147 'id': 'io/processes', |
| 146 'type': 'ProcessList', | 148 'type': 'ProcessList', |
| 147 'members': _ProcessImpl._processes.values | 149 'members': _ProcessImpl._processes.values |
| 148 .map((p) => p._toJSON(true)).toList(), | 150 .map((p) => p._toJSON(true)).toList(), |
| 149 }; | 151 }; |
| 150 } | 152 } |
| OLD | NEW |