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 // Some value smaller than the object ring, so requesting a large array | 7 // Some value smaller than the object ring, so requesting a large array |
8 // doesn't result in an expired ref because the elements lapped it in the | 8 // doesn't result in an expired ref because the elements lapped it in the |
9 // object ring. | 9 // object ring. |
10 const int kDefaultFieldLimit = 100; | 10 const int kDefaultFieldLimit = 100; |
(...skipping 1153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1164 } | 1164 } |
1165 | 1165 |
1166 @observable ServiceEvent pauseEvent = null; | 1166 @observable ServiceEvent pauseEvent = null; |
1167 @observable bool paused = false; | 1167 @observable bool paused = false; |
1168 @observable bool running = false; | 1168 @observable bool running = false; |
1169 @observable bool idle = false; | 1169 @observable bool idle = false; |
1170 @observable bool loading = true; | 1170 @observable bool loading = true; |
1171 | 1171 |
1172 @observable bool ioEnabled = false; | 1172 @observable bool ioEnabled = false; |
1173 | 1173 |
| 1174 final List<String> extensionRPCs = new List<String>(); |
| 1175 |
1174 Map<String,ServiceObject> _cache = new Map<String,ServiceObject>(); | 1176 Map<String,ServiceObject> _cache = new Map<String,ServiceObject>(); |
1175 final TagProfile tagProfile = new TagProfile(20); | 1177 final TagProfile tagProfile = new TagProfile(20); |
1176 | 1178 |
1177 Isolate._empty(ServiceObjectOwner owner) : super._empty(owner) { | 1179 Isolate._empty(ServiceObjectOwner owner) : super._empty(owner) { |
1178 assert(owner is VM); | 1180 assert(owner is VM); |
1179 } | 1181 } |
1180 | 1182 |
1181 void resetCachedProfileData() { | 1183 void resetCachedProfileData() { |
1182 _cache.values.forEach((value) { | 1184 _cache.values.forEach((value) { |
1183 if (value is Code) { | 1185 if (value is Code) { |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1429 pauseEvent = newPauseEvent; | 1431 pauseEvent = newPauseEvent; |
1430 _updateRunState(); | 1432 _updateRunState(); |
1431 error = map['error']; | 1433 error = map['error']; |
1432 | 1434 |
1433 libraries.clear(); | 1435 libraries.clear(); |
1434 libraries.addAll(map['libraries']); | 1436 libraries.addAll(map['libraries']); |
1435 libraries.sort(ServiceObject.LexicalSortName); | 1437 libraries.sort(ServiceObject.LexicalSortName); |
1436 if (savedStartTime == null) { | 1438 if (savedStartTime == null) { |
1437 vm._buildIsolateList(); | 1439 vm._buildIsolateList(); |
1438 } | 1440 } |
| 1441 |
| 1442 extensionRPCs.clear(); |
| 1443 if (map['extensionRPCs'] != null) { |
| 1444 extensionRPCs.addAll(map['extensionRPCs']); |
| 1445 } |
1439 } | 1446 } |
1440 | 1447 |
1441 Future<TagProfile> updateTagProfile() { | 1448 Future<TagProfile> updateTagProfile() { |
1442 return isolate.invokeRpcNoUpgrade('_getTagProfile', {}).then( | 1449 return isolate.invokeRpcNoUpgrade('_getTagProfile', {}).then( |
1443 (ObservableMap map) { | 1450 (ObservableMap map) { |
1444 var seconds = new DateTime.now().millisecondsSinceEpoch / 1000.0; | 1451 var seconds = new DateTime.now().millisecondsSinceEpoch / 1000.0; |
1445 tagProfile._processTagProfile(seconds, map); | 1452 tagProfile._processTagProfile(seconds, map); |
1446 return tagProfile; | 1453 return tagProfile; |
1447 }); | 1454 }); |
1448 } | 1455 } |
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1877 } | 1884 } |
1878 | 1885 |
1879 /// A [ServiceEvent] is an asynchronous event notification from the vm. | 1886 /// A [ServiceEvent] is an asynchronous event notification from the vm. |
1880 class ServiceEvent extends ServiceObject { | 1887 class ServiceEvent extends ServiceObject { |
1881 /// The possible 'kind' values. | 1888 /// The possible 'kind' values. |
1882 static const kVMUpdate = 'VMUpdate'; | 1889 static const kVMUpdate = 'VMUpdate'; |
1883 static const kIsolateStart = 'IsolateStart'; | 1890 static const kIsolateStart = 'IsolateStart'; |
1884 static const kIsolateRunnable = 'IsolateRunnable'; | 1891 static const kIsolateRunnable = 'IsolateRunnable'; |
1885 static const kIsolateExit = 'IsolateExit'; | 1892 static const kIsolateExit = 'IsolateExit'; |
1886 static const kIsolateUpdate = 'IsolateUpdate'; | 1893 static const kIsolateUpdate = 'IsolateUpdate'; |
| 1894 static const kServiceExtensionAdded = 'ServiceExtensionAdded'; |
1887 static const kPauseStart = 'PauseStart'; | 1895 static const kPauseStart = 'PauseStart'; |
1888 static const kPauseExit = 'PauseExit'; | 1896 static const kPauseExit = 'PauseExit'; |
1889 static const kPauseBreakpoint = 'PauseBreakpoint'; | 1897 static const kPauseBreakpoint = 'PauseBreakpoint'; |
1890 static const kPauseInterrupted = 'PauseInterrupted'; | 1898 static const kPauseInterrupted = 'PauseInterrupted'; |
1891 static const kPauseException = 'PauseException'; | 1899 static const kPauseException = 'PauseException'; |
1892 static const kResume = 'Resume'; | 1900 static const kResume = 'Resume'; |
1893 static const kBreakpointAdded = 'BreakpointAdded'; | 1901 static const kBreakpointAdded = 'BreakpointAdded'; |
1894 static const kBreakpointResolved = 'BreakpointResolved'; | 1902 static const kBreakpointResolved = 'BreakpointResolved'; |
1895 static const kBreakpointRemoved = 'BreakpointRemoved'; | 1903 static const kBreakpointRemoved = 'BreakpointRemoved'; |
1896 static const kGraph = '_Graph'; | 1904 static const kGraph = '_Graph'; |
1897 static const kGC = 'GC'; | 1905 static const kGC = 'GC'; |
1898 static const kInspect = 'Inspect'; | 1906 static const kInspect = 'Inspect'; |
1899 static const kDebuggerSettingsUpdate = '_DebuggerSettingsUpdate'; | 1907 static const kDebuggerSettingsUpdate = '_DebuggerSettingsUpdate'; |
1900 static const kConnectionClosed = 'ConnectionClosed'; | 1908 static const kConnectionClosed = 'ConnectionClosed'; |
1901 static const kLogging = '_Logging'; | 1909 static const kLogging = '_Logging'; |
1902 | 1910 |
1903 ServiceEvent._empty(ServiceObjectOwner owner) : super._empty(owner); | 1911 ServiceEvent._empty(ServiceObjectOwner owner) : super._empty(owner); |
1904 | 1912 |
1905 ServiceEvent.connectionClosed(this.reason) : super._empty(null) { | 1913 ServiceEvent.connectionClosed(this.reason) : super._empty(null) { |
1906 kind = kConnectionClosed; | 1914 kind = kConnectionClosed; |
1907 } | 1915 } |
1908 | 1916 |
1909 @observable String kind; | 1917 @observable String kind; |
1910 @observable DateTime timestamp; | 1918 @observable DateTime timestamp; |
1911 @observable Breakpoint breakpoint; | 1919 @observable Breakpoint breakpoint; |
1912 @observable Frame topFrame; | 1920 @observable Frame topFrame; |
| 1921 @observable String extensionRPC; |
1913 @observable Instance exception; | 1922 @observable Instance exception; |
1914 @observable Instance asyncContinuation; | 1923 @observable Instance asyncContinuation; |
1915 @observable bool atAsyncJump; | 1924 @observable bool atAsyncJump; |
1916 @observable ServiceObject inspectee; | 1925 @observable ServiceObject inspectee; |
1917 @observable ByteData data; | 1926 @observable ByteData data; |
1918 @observable int count; | 1927 @observable int count; |
1919 @observable String reason; | 1928 @observable String reason; |
1920 @observable String exceptions; | 1929 @observable String exceptions; |
1921 @observable String bytesAsString; | 1930 @observable String bytesAsString; |
1922 @observable Map logRecord; | 1931 @observable Map logRecord; |
(...skipping 22 matching lines...) Expand all Loading... |
1945 breakpoint = map['breakpoint']; | 1954 breakpoint = map['breakpoint']; |
1946 } | 1955 } |
1947 // TODO(turnidge): Expose the full list of breakpoints. For now | 1956 // TODO(turnidge): Expose the full list of breakpoints. For now |
1948 // we just pretend like there is only one active breakpoint. | 1957 // we just pretend like there is only one active breakpoint. |
1949 if (map['pauseBreakpoints'] != null) { | 1958 if (map['pauseBreakpoints'] != null) { |
1950 var pauseBpts = map['pauseBreakpoints']; | 1959 var pauseBpts = map['pauseBreakpoints']; |
1951 if (pauseBpts.length > 0) { | 1960 if (pauseBpts.length > 0) { |
1952 breakpoint = pauseBpts[0]; | 1961 breakpoint = pauseBpts[0]; |
1953 } | 1962 } |
1954 } | 1963 } |
| 1964 if (map['extensionRPC'] != null) { |
| 1965 extensionRPC = map['extensionRPC']; |
| 1966 } |
1955 topFrame = map['topFrame']; | 1967 topFrame = map['topFrame']; |
1956 if (map['exception'] != null) { | 1968 if (map['exception'] != null) { |
1957 exception = map['exception']; | 1969 exception = map['exception']; |
1958 } | 1970 } |
1959 if (map['_asyncContinuation'] != null) { | 1971 if (map['_asyncContinuation'] != null) { |
1960 asyncContinuation = map['_asyncContinuation']; | 1972 asyncContinuation = map['_asyncContinuation']; |
1961 atAsyncJump = map['_atAsyncJump']; | 1973 atAsyncJump = map['_atAsyncJump']; |
1962 } else { | 1974 } else { |
1963 atAsyncJump = false; | 1975 atAsyncJump = false; |
1964 } | 1976 } |
(...skipping 2079 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4044 var v = list[i]; | 4056 var v = list[i]; |
4045 if ((v is ObservableMap) && _isServiceMap(v)) { | 4057 if ((v is ObservableMap) && _isServiceMap(v)) { |
4046 list[i] = owner.getFromMap(v); | 4058 list[i] = owner.getFromMap(v); |
4047 } else if (v is ObservableList) { | 4059 } else if (v is ObservableList) { |
4048 _upgradeObservableList(v, owner); | 4060 _upgradeObservableList(v, owner); |
4049 } else if (v is ObservableMap) { | 4061 } else if (v is ObservableMap) { |
4050 _upgradeObservableMap(v, owner); | 4062 _upgradeObservableMap(v, owner); |
4051 } | 4063 } |
4052 } | 4064 } |
4053 } | 4065 } |
OLD | NEW |