OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 repositories; | 5 part of repositories; |
6 | 6 |
7 class EventRepository implements M.EventRepository { | 7 class EventRepository implements M.EventRepository { |
8 final StreamController<M.Event> _onEvent; | 8 final StreamController<M.Event> _onEvent; |
9 Stream<M.Event> get onEvent => _onEvent.stream; | 9 Stream<M.Event> get onEvent => _onEvent.stream; |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... |
29 final Stream<M.BreakpointRemovedEvent> onBreakpointRemoved; | 29 final Stream<M.BreakpointRemovedEvent> onBreakpointRemoved; |
30 final Stream<M.InspectEvent> onInspect; | 30 final Stream<M.InspectEvent> onInspect; |
31 final Stream<M.GCEvent> onGCEvent; | 31 final Stream<M.GCEvent> onGCEvent; |
32 final Stream<M.LoggingEvent> onLoggingEvent; | 32 final Stream<M.LoggingEvent> onLoggingEvent; |
33 final Stream<M.ExtensionEvent> onExtensionEvent; | 33 final Stream<M.ExtensionEvent> onExtensionEvent; |
34 final Stream<M.TimelineEventsEvent> onTimelineEvents; | 34 final Stream<M.TimelineEventsEvent> onTimelineEvents; |
35 final Stream<M.ConnectionClosedEvent> onConnectionClosed; | 35 final Stream<M.ConnectionClosedEvent> onConnectionClosed; |
36 | 36 |
37 EventRepository() : this._(new StreamController.broadcast()); | 37 EventRepository() : this._(new StreamController.broadcast()); |
38 | 38 |
39 EventRepository._(StreamController controller) : this.__(controller, | 39 EventRepository._(StreamController controller) |
40 controller.stream.where((e) => e is M.VMEvent), | 40 : this.__( |
41 controller.stream.where((e) => e is M.IsolateEvent), | 41 controller, |
42 controller.stream.where((e) => e is M.DebugEvent), | 42 controller.stream.where((e) => e is M.VMEvent), |
43 controller.stream.where((e) => e is M.GCEvent), | 43 controller.stream.where((e) => e is M.IsolateEvent), |
44 controller.stream.where((e) => e is M.LoggingEvent), | 44 controller.stream.where((e) => e is M.DebugEvent), |
45 controller.stream.where((e) => e is M.ExtensionEvent), | 45 controller.stream.where((e) => e is M.GCEvent), |
46 controller.stream.where((e) => e is M.TimelineEventsEvent), | 46 controller.stream.where((e) => e is M.LoggingEvent), |
47 controller.stream.where((e) => e is M.ConnectionClosedEvent)); | 47 controller.stream.where((e) => e is M.ExtensionEvent), |
| 48 controller.stream.where((e) => e is M.TimelineEventsEvent), |
| 49 controller.stream.where((e) => e is M.ConnectionClosedEvent)); |
48 | 50 |
49 EventRepository.__(StreamController controller, | 51 EventRepository.__( |
50 Stream<M.VMEvent> onVMEvent, Stream<M.IsolateEvent> onIsolateEvent, | 52 StreamController controller, |
51 Stream<M.DebugEvent> onDebugEvent, Stream<M.GCEvent> onGCEvent, | 53 Stream<M.VMEvent> onVMEvent, |
52 Stream<M.LoggingEvent> onLoggingEvent, | 54 Stream<M.IsolateEvent> onIsolateEvent, |
53 Stream<M.ExtensionEvent> onExtensionEvent, | 55 Stream<M.DebugEvent> onDebugEvent, |
54 Stream<M.TimelineEventsEvent> onTimelineEvents, | 56 Stream<M.GCEvent> onGCEvent, |
55 Stream<M.ConnectionClosedEvent> onConnectionClosed) | 57 Stream<M.LoggingEvent> onLoggingEvent, |
56 : _onEvent = controller, | 58 Stream<M.ExtensionEvent> onExtensionEvent, |
57 onVMEvent = onVMEvent, | 59 Stream<M.TimelineEventsEvent> onTimelineEvents, |
58 onVMUpdate = onVMEvent.where((e) => e is M.VMUpdateEvent), | 60 Stream<M.ConnectionClosedEvent> onConnectionClosed) |
59 onIsolateEvent = onIsolateEvent, | 61 : _onEvent = controller, |
60 onIsolateStart = onIsolateEvent.where((e) => e is M.IsolateStartEvent), | 62 onVMEvent = onVMEvent, |
61 onIsolateRunnable = | 63 onVMUpdate = onVMEvent.where((e) => e is M.VMUpdateEvent), |
62 onIsolateEvent.where((e) => e is M.IsolateRunnableEvent), | 64 onIsolateEvent = onIsolateEvent, |
63 onIsolateExit = onIsolateEvent.where((e) => e is M.IsolateExitEvent), | 65 onIsolateStart = onIsolateEvent.where((e) => e is M.IsolateStartEvent), |
64 onIsolateUpdate = onIsolateEvent.where((e) => e is M.IsolateUpdateEvent), | 66 onIsolateRunnable = |
65 onIsolateReload = onIsolateEvent.where((e) => e is M.IsolateReloadEvent), | 67 onIsolateEvent.where((e) => e is M.IsolateRunnableEvent), |
66 onServiceExtensionAdded = | 68 onIsolateExit = onIsolateEvent.where((e) => e is M.IsolateExitEvent), |
67 onIsolateEvent.where((e) => e is M.IsolateReloadEvent), | 69 onIsolateUpdate = |
68 onDebugEvent = onDebugEvent, | 70 onIsolateEvent.where((e) => e is M.IsolateUpdateEvent), |
69 onPauseStart = onDebugEvent.where((e) => e is M.PauseStartEvent), | 71 onIsolateReload = |
70 onPauseExit = onDebugEvent.where((e) => e is M.PauseExitEvent), | 72 onIsolateEvent.where((e) => e is M.IsolateReloadEvent), |
71 onPauseBreakpoint = | 73 onServiceExtensionAdded = |
72 onDebugEvent.where((e) => e is M.PauseBreakpointEvent), | 74 onIsolateEvent.where((e) => e is M.IsolateReloadEvent), |
73 onPauseInterrupted = | 75 onDebugEvent = onDebugEvent, |
74 onDebugEvent.where((e) => e is M.PauseInterruptedEvent), | 76 onPauseStart = onDebugEvent.where((e) => e is M.PauseStartEvent), |
75 onPauseException = onDebugEvent.where((e) => e is M.PauseExceptionEvent), | 77 onPauseExit = onDebugEvent.where((e) => e is M.PauseExitEvent), |
76 onResume = onDebugEvent.where((e) => e is M.ResumeEvent), | 78 onPauseBreakpoint = |
77 onBreakpointAdded = | 79 onDebugEvent.where((e) => e is M.PauseBreakpointEvent), |
78 onDebugEvent.where((e) => e is M.BreakpointAddedEvent), | 80 onPauseInterrupted = |
79 onBreakpointResolved = | 81 onDebugEvent.where((e) => e is M.PauseInterruptedEvent), |
80 onDebugEvent.where((e) => e is M.BreakpointResolvedEvent), | 82 onPauseException = |
81 onBreakpointRemoved = | 83 onDebugEvent.where((e) => e is M.PauseExceptionEvent), |
82 onDebugEvent.where((e) => e is M.BreakpointRemovedEvent), | 84 onResume = onDebugEvent.where((e) => e is M.ResumeEvent), |
83 onInspect = onDebugEvent.where((e) => e is M.InspectEvent), | 85 onBreakpointAdded = |
84 onGCEvent = onGCEvent, | 86 onDebugEvent.where((e) => e is M.BreakpointAddedEvent), |
85 onLoggingEvent = onLoggingEvent, | 87 onBreakpointResolved = |
86 onExtensionEvent = onExtensionEvent, | 88 onDebugEvent.where((e) => e is M.BreakpointResolvedEvent), |
87 onTimelineEvents = onTimelineEvents, | 89 onBreakpointRemoved = |
88 onConnectionClosed = onConnectionClosed; | 90 onDebugEvent.where((e) => e is M.BreakpointRemovedEvent), |
| 91 onInspect = onDebugEvent.where((e) => e is M.InspectEvent), |
| 92 onGCEvent = onGCEvent, |
| 93 onLoggingEvent = onLoggingEvent, |
| 94 onExtensionEvent = onExtensionEvent, |
| 95 onTimelineEvents = onTimelineEvents, |
| 96 onConnectionClosed = onConnectionClosed; |
89 | 97 |
90 void add(M.Event e) { | 98 void add(M.Event e) { |
91 _onEvent.add(e); | 99 _onEvent.add(e); |
92 } | 100 } |
93 } | 101 } |
OLD | NEW |