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

Unified Diff: runtime/bin/vmservice/observatory/lib/src/service/object.dart

Issue 474633002: Optional binary payloads in VM service events. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: runtime/bin/vmservice/observatory/lib/src/service/object.dart
===================================================================
--- runtime/bin/vmservice/observatory/lib/src/service/object.dart (revision 39330)
+++ runtime/bin/vmservice/observatory/lib/src/service/object.dart (working copy)
@@ -253,10 +253,14 @@
final StreamController<ServiceEvent> events =
new StreamController.broadcast();
- void postEventMessage(String eventMessage) {
+ void postEventMessage(String eventMessage, [dynamic data]) {
var map;
try {
map = _parseJSON(eventMessage);
+ assert(!map.containsKey('_data'));
+ if (data != null) {
+ map['_data'] = data;
+ }
} catch (e, st) {
Logger.root.severe('Ignoring malformed event message: ${eventMessage}');
return;
@@ -1167,6 +1171,7 @@
@observable String eventType;
@observable ServiceMap breakpoint;
@observable ServiceMap exception;
+ @observable ByteData data;
void _update(ObservableMap map, bool mapIsRef) {
_loaded = true;
@@ -1180,7 +1185,15 @@
if (map['exception'] != null) {
exception = map['exception'];
}
+ if (map['_data'] != null) {
+ data = map['_data'];
+ }
}
+
+ String toString() {
+ return 'ServiceEvent of type $eventType with '
+ '${data == null ? 0 : data.lengthInBytes} bytes of binary data';
+ }
}
class Library extends ServiceObject with Coverage {
« no previous file with comments | « runtime/bin/vmservice/observatory/lib/src/app/application.dart ('k') | runtime/bin/vmservice/observatory/test/echo_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698