| 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 /// Helper function for canceling a Future<StreamSubscription>. | 7 /// Helper function for canceling a Future<StreamSubscription>. |
| 8 Future cancelFutureSubscription( | 8 Future cancelFutureSubscription( |
| 9 Future<StreamSubscription> subscriptionFuture) async { | 9 Future<StreamSubscription> subscriptionFuture) async { |
| 10 if (subscriptionFuture != null) { | 10 if (subscriptionFuture != null) { |
| (...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 690 return invokeRpc('streamCancel', params); | 690 return invokeRpc('streamCancel', params); |
| 691 } | 691 } |
| 692 | 692 |
| 693 // A map from stream id to event stream state. | 693 // A map from stream id to event stream state. |
| 694 Map<String,_EventStreamState> _eventStreams = {}; | 694 Map<String,_EventStreamState> _eventStreams = {}; |
| 695 | 695 |
| 696 // Well-known stream ids. | 696 // Well-known stream ids. |
| 697 static const kIsolateStream = 'Isolate'; | 697 static const kIsolateStream = 'Isolate'; |
| 698 static const kDebugStream = 'Debug'; | 698 static const kDebugStream = 'Debug'; |
| 699 static const kGCStream = 'GC'; | 699 static const kGCStream = 'GC'; |
| 700 static const kStdoutStream = 'Stdout'; |
| 701 static const kStderrStream = 'Stderr'; |
| 700 static const _kGraphStream = '_Graph'; | 702 static const _kGraphStream = '_Graph'; |
| 701 | 703 |
| 702 /// Returns a single-subscription Stream object for a VM event stream. | 704 /// Returns a single-subscription Stream object for a VM event stream. |
| 703 Future<Stream> getEventStream(String streamId) async { | 705 Future<Stream> getEventStream(String streamId) async { |
| 704 var eventStream = _eventStreams.putIfAbsent( | 706 var eventStream = _eventStreams.putIfAbsent( |
| 705 streamId, () => new _EventStreamState( | 707 streamId, () => new _EventStreamState( |
| 706 this, streamId, () => _eventStreams.remove(streamId))); | 708 this, streamId, () => _eventStreams.remove(streamId))); |
| 707 return eventStream.addStream(); | 709 return eventStream.addStream(); |
| 708 } | 710 } |
| 709 | 711 |
| (...skipping 908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1618 | 1620 |
| 1619 @observable String kind; | 1621 @observable String kind; |
| 1620 @observable Breakpoint breakpoint; | 1622 @observable Breakpoint breakpoint; |
| 1621 @observable Frame topFrame; | 1623 @observable Frame topFrame; |
| 1622 @observable Instance exception; | 1624 @observable Instance exception; |
| 1623 @observable ServiceObject inspectee; | 1625 @observable ServiceObject inspectee; |
| 1624 @observable ByteData data; | 1626 @observable ByteData data; |
| 1625 @observable int count; | 1627 @observable int count; |
| 1626 @observable String reason; | 1628 @observable String reason; |
| 1627 @observable String exceptions; | 1629 @observable String exceptions; |
| 1630 @observable String bytesAsString; |
| 1628 int chunkIndex, chunkCount, nodeCount; | 1631 int chunkIndex, chunkCount, nodeCount; |
| 1629 | 1632 |
| 1630 @observable bool get isPauseEvent { | 1633 @observable bool get isPauseEvent { |
| 1631 return (kind == kPauseStart || | 1634 return (kind == kPauseStart || |
| 1632 kind == kPauseExit || | 1635 kind == kPauseExit || |
| 1633 kind == kPauseBreakpoint || | 1636 kind == kPauseBreakpoint || |
| 1634 kind == kPauseInterrupted || | 1637 kind == kPauseInterrupted || |
| 1635 kind == kPauseException); | 1638 kind == kPauseException); |
| 1636 } | 1639 } |
| 1637 | 1640 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1673 if (map['nodeCount'] != null) { | 1676 if (map['nodeCount'] != null) { |
| 1674 nodeCount = map['nodeCount']; | 1677 nodeCount = map['nodeCount']; |
| 1675 } | 1678 } |
| 1676 if (map['count'] != null) { | 1679 if (map['count'] != null) { |
| 1677 count = map['count']; | 1680 count = map['count']; |
| 1678 } | 1681 } |
| 1679 if (map['_debuggerSettings'] != null && | 1682 if (map['_debuggerSettings'] != null && |
| 1680 map['_debuggerSettings']['_exceptions'] != null) { | 1683 map['_debuggerSettings']['_exceptions'] != null) { |
| 1681 exceptions = map['_debuggerSettings']['_exceptions']; | 1684 exceptions = map['_debuggerSettings']['_exceptions']; |
| 1682 } | 1685 } |
| 1686 if (map['bytes'] != null) { |
| 1687 var bytes = decodeBase64(map['bytes']); |
| 1688 bytesAsString = UTF8.decode(bytes); |
| 1689 } |
| 1683 } | 1690 } |
| 1684 | 1691 |
| 1685 String toString() { | 1692 String toString() { |
| 1686 if (data == null) { | 1693 if (data == null) { |
| 1687 return "ServiceEvent(owner='${owner.id}', kind='${kind}')"; | 1694 return "ServiceEvent(owner='${owner.id}', kind='${kind}')"; |
| 1688 } else { | 1695 } else { |
| 1689 return "ServiceEvent(owner='${owner.id}', kind='${kind}', " | 1696 return "ServiceEvent(owner='${owner.id}', kind='${kind}', " |
| 1690 "data.lengthInBytes=${data.lengthInBytes})"; | 1697 "data.lengthInBytes=${data.lengthInBytes})"; |
| 1691 } | 1698 } |
| 1692 } | 1699 } |
| (...skipping 1879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3572 var v = list[i]; | 3579 var v = list[i]; |
| 3573 if ((v is ObservableMap) && _isServiceMap(v)) { | 3580 if ((v is ObservableMap) && _isServiceMap(v)) { |
| 3574 list[i] = owner.getFromMap(v); | 3581 list[i] = owner.getFromMap(v); |
| 3575 } else if (v is ObservableList) { | 3582 } else if (v is ObservableList) { |
| 3576 _upgradeObservableList(v, owner); | 3583 _upgradeObservableList(v, owner); |
| 3577 } else if (v is ObservableMap) { | 3584 } else if (v is ObservableMap) { |
| 3578 _upgradeObservableMap(v, owner); | 3585 _upgradeObservableMap(v, owner); |
| 3579 } | 3586 } |
| 3580 } | 3587 } |
| 3581 } | 3588 } |
| OLD | NEW |