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

Unified Diff: runtime/observatory/lib/src/app/application.dart

Issue 979823003: Major rework of vm service events. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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
« no previous file with comments | « no previous file | runtime/observatory/lib/src/elements/debugger.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/observatory/lib/src/app/application.dart
diff --git a/runtime/observatory/lib/src/app/application.dart b/runtime/observatory/lib/src/app/application.dart
index c5413c9dd03b5a44a7f38572db10126b725bb5e8..d06c6e19e7a234ac41a9e097bd8219752bfa65aa 100644
--- a/runtime/observatory/lib/src/app/application.dart
+++ b/runtime/observatory/lib/src/app/application.dart
@@ -51,9 +51,11 @@ class ObservatoryApplication extends Observable {
void removePauseEvents(Isolate isolate) {
bool isPauseEvent(var event) {
- return (event.eventType == 'IsolateInterrupted' ||
- event.eventType == 'BreakpointReached' ||
- event.eventType == 'ExceptionThrown');
+ return (event.eventType == ServiceEvent.kPauseStart ||
+ event.eventType == ServiceEvent.kPauseExit ||
+ event.eventType == ServiceEvent.kPauseBreakpoint ||
+ event.eventType == ServiceEvent.kPauseInterrupted ||
+ event.eventType == ServiceEvent.kPauseException);
}
notifications.removeWhere((oldEvent) {
@@ -64,46 +66,29 @@ class ObservatoryApplication extends Observable {
void _onEvent(ServiceEvent event) {
switch(event.eventType) {
- case 'IsolateCreated':
+ case ServiceEvent.kIsolateStart:
+ case ServiceEvent.kGraph:
+ case ServiceEvent.kBreakpointAdded:
+ case ServiceEvent.kBreakpointResolved:
+ case ServiceEvent.kBreakpointRemoved:
+ case ServiceEvent.kGC:
// Ignore for now.
break;
- case 'IsolateResumed':
- event.isolate.pauseEvent = null;
- break;
-
- case 'IsolateShutdown':
- // TODO(turnidge): Should we show the user isolate shutdown events?
- // What if there are hundreds of them? Coalesce multiple
- // shutdown events into one notification?
+ case ServiceEvent.kIsolateExit:
+ case ServiceEvent.kResume:
removePauseEvents(event.isolate);
-
- // TODO(turnidge): Reload the isolate for now in case it is
- // paused. We may need to distinguish an IsolateShutdown
- // event from a "paused at isolate shutdown" event.
- event.isolate.reload();
- break;
-
- case 'BreakpointResolved':
- event.isolate.reloadBreakpoints();
break;
- case 'BreakpointReached':
- case 'IsolateInterrupted':
- case 'ExceptionThrown':
- event.isolate.pauseEvent = event;
+ case ServiceEvent.kPauseStart:
+ case ServiceEvent.kPauseExit:
+ case ServiceEvent.kPauseBreakpoint:
+ case ServiceEvent.kPauseInterrupted:
+ case ServiceEvent.kPauseException:
removePauseEvents(event.isolate);
notifications.add(event);
break;
- case '_Graph':
- event.isolate.loadHeapSnapshot(event);
- break;
-
- case 'GC':
- // Ignore GC events for now.
- break;
-
default:
// Ignore unrecognized events.
Logger.root.severe('Unrecognized event: $event');
@@ -217,7 +202,7 @@ class ObservatoryApplication extends Observable {
void _removeDisconnectEvents() {
notifications.removeWhere((oldEvent) {
- return (oldEvent.eventType == 'VMDisconnected');
+ return (oldEvent.eventType == ServiceEvent.kVMDisconnected);
});
}
« no previous file with comments | « no previous file | runtime/observatory/lib/src/elements/debugger.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698