| 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 part of service; | 5 part of service; |
| 6 | 6 |
| 7 /// An RpcException represents an exceptional event that happened | 7 /// An RpcException represents an exceptional event that happened |
| 8 /// while invoking an rpc. | 8 /// while invoking an rpc. |
| 9 abstract class RpcException implements Exception { | 9 abstract class RpcException implements Exception { |
| 10 RpcException(this.message); | 10 RpcException(this.message); |
| (...skipping 976 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 987 name = map['name']; | 987 name = map['name']; |
| 988 vmName = map['name']; | 988 vmName = map['name']; |
| 989 number = int.parse(map['number'], onError:(_) => null); | 989 number = int.parse(map['number'], onError:(_) => null); |
| 990 if (mapIsRef) { | 990 if (mapIsRef) { |
| 991 return; | 991 return; |
| 992 } | 992 } |
| 993 _loaded = true; | 993 _loaded = true; |
| 994 loading = false; | 994 loading = false; |
| 995 | 995 |
| 996 _upgradeCollection(map, isolate); | 996 _upgradeCollection(map, isolate); |
| 997 if (map['rootLib'] == null || | |
| 998 map['timers'] == null || | |
| 999 map['heaps'] == null) { | |
| 1000 Logger.root.severe("Malformed 'Isolate' response: $map"); | |
| 1001 return; | |
| 1002 } | |
| 1003 rootLibrary = map['rootLib']; | 997 rootLibrary = map['rootLib']; |
| 1004 if (map['entry'] != null) { | 998 if (map['entry'] != null) { |
| 1005 entry = map['entry']; | 999 entry = map['entry']; |
| 1006 } | 1000 } |
| 1007 var startTimeInMillis = map['startTime']; | 1001 var startTimeInMillis = map['startTime']; |
| 1008 startTime = new DateTime.fromMillisecondsSinceEpoch(startTimeInMillis); | 1002 startTime = new DateTime.fromMillisecondsSinceEpoch(startTimeInMillis); |
| 1009 notifyPropertyChange(#upTime, 0, 1); | 1003 notifyPropertyChange(#upTime, 0, 1); |
| 1010 var countersMap = map['tagCounters']; | 1004 var countersMap = map['_tagCounters']; |
| 1011 if (countersMap != null) { | 1005 if (countersMap != null) { |
| 1012 var names = countersMap['names']; | 1006 var names = countersMap['names']; |
| 1013 var counts = countersMap['counters']; | 1007 var counts = countersMap['counters']; |
| 1014 assert(names.length == counts.length); | 1008 assert(names.length == counts.length); |
| 1015 var sum = 0; | 1009 var sum = 0; |
| 1016 for (var i = 0; i < counts.length; i++) { | 1010 for (var i = 0; i < counts.length; i++) { |
| 1017 sum += counts[i]; | 1011 sum += counts[i]; |
| 1018 } | 1012 } |
| 1019 // TODO: Why does this not work without this? | 1013 // TODO: Why does this not work without this? |
| 1020 counters = toObservable({}); | 1014 counters = toObservable({}); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 1035 }); | 1029 }); |
| 1036 timers['total'] = timerMap['time_total_runtime']; | 1030 timers['total'] = timerMap['time_total_runtime']; |
| 1037 timers['compile'] = timerMap['time_compilation']; | 1031 timers['compile'] = timerMap['time_compilation']; |
| 1038 timers['gc'] = 0.0; // TODO(turnidge): Export this from VM. | 1032 timers['gc'] = 0.0; // TODO(turnidge): Export this from VM. |
| 1039 timers['init'] = (timerMap['time_script_loading'] + | 1033 timers['init'] = (timerMap['time_script_loading'] + |
| 1040 timerMap['time_creating_snapshot'] + | 1034 timerMap['time_creating_snapshot'] + |
| 1041 timerMap['time_isolate_initialization'] + | 1035 timerMap['time_isolate_initialization'] + |
| 1042 timerMap['time_bootstrap']); | 1036 timerMap['time_bootstrap']); |
| 1043 timers['dart'] = timerMap['time_dart_execution']; | 1037 timers['dart'] = timerMap['time_dart_execution']; |
| 1044 | 1038 |
| 1045 updateHeapsFromMap(map['heaps']); | 1039 updateHeapsFromMap(map['_heaps']); |
| 1046 _updateBreakpoints(map['breakpoints']); | 1040 _updateBreakpoints(map['breakpoints']); |
| 1047 | 1041 |
| 1048 List features = map['features']; | |
| 1049 if (features != null) { | |
| 1050 for (var feature in features) { | |
| 1051 if (feature == 'io') { | |
| 1052 ioEnabled = true; | |
| 1053 } | |
| 1054 } | |
| 1055 } | |
| 1056 pauseEvent = map['pauseEvent']; | 1042 pauseEvent = map['pauseEvent']; |
| 1057 _updateRunState(); | 1043 _updateRunState(); |
| 1058 error = map['error']; | 1044 error = map['error']; |
| 1059 | 1045 |
| 1060 libraries.clear(); | 1046 libraries.clear(); |
| 1061 libraries.addAll(map['libraries']); | 1047 libraries.addAll(map['libraries']); |
| 1062 libraries.sort(ServiceObject.LexicalSortName); | 1048 libraries.sort(ServiceObject.LexicalSortName); |
| 1063 } | 1049 } |
| 1064 | 1050 |
| 1065 Future<TagProfile> updateTagProfile() { | 1051 Future<TagProfile> updateTagProfile() { |
| (...skipping 2047 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3113 var v = list[i]; | 3099 var v = list[i]; |
| 3114 if ((v is ObservableMap) && _isServiceMap(v)) { | 3100 if ((v is ObservableMap) && _isServiceMap(v)) { |
| 3115 list[i] = owner.getFromMap(v); | 3101 list[i] = owner.getFromMap(v); |
| 3116 } else if (v is ObservableList) { | 3102 } else if (v is ObservableList) { |
| 3117 _upgradeObservableList(v, owner); | 3103 _upgradeObservableList(v, owner); |
| 3118 } else if (v is ObservableMap) { | 3104 } else if (v is ObservableMap) { |
| 3119 _upgradeObservableMap(v, owner); | 3105 _upgradeObservableMap(v, owner); |
| 3120 } | 3106 } |
| 3121 } | 3107 } |
| 3122 } | 3108 } |
| OLD | NEW |