OLD | NEW |
(Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 part of repositories; |
| 6 |
| 7 class EventRepository implements M.EventRepository { |
| 8 final StreamController<M.Event> _onEvent; |
| 9 Stream<M.Event> get onEvent => _onEvent.stream; |
| 10 |
| 11 final Stream<M.VMEvent> onVMEvent; |
| 12 final Stream<M.VMUpdateEvent> onVMUpdate; |
| 13 final Stream<M.IsolateEvent> onIsolateEvent; |
| 14 final Stream<M.IsolateStartEvent> onIsolateStart; |
| 15 final Stream<M.IsolateRunnableEvent> onIsolateRunnable; |
| 16 final Stream<M.IsolateExitEvent> onIsolateExit; |
| 17 final Stream<M.IsolateUpdateEvent> onIsolateUpdate; |
| 18 final Stream<M.IsolateReloadEvent> onIsolateReload; |
| 19 final Stream<M.ServiceExtensionAddedEvent> onServiceExtensionAdded; |
| 20 final Stream<M.DebugEvent> onDebugEvent; |
| 21 final Stream<M.PauseStartEvent> onPauseStart; |
| 22 final Stream<M.PauseExitEvent> onPauseExit; |
| 23 final Stream<M.PauseBreakpointEvent> onPauseBreakpoint; |
| 24 final Stream<M.PauseInterruptedEvent> onPauseInterrupted; |
| 25 final Stream<M.PauseExceptionEvent> onPauseException; |
| 26 final Stream<M.ResumeEvent> onResume; |
| 27 final Stream<M.BreakpointAddedEvent> onBreakpointAdded; |
| 28 final Stream<M.BreakpointResolvedEvent> onBreakpointResolved; |
| 29 final Stream<M.BreakpointRemovedEvent> onBreakpointRemoved; |
| 30 final Stream<M.InspectEvent> onInspect; |
| 31 final Stream<M.GCEvent> onGCEvent; |
| 32 final Stream<M.ExtensionEvent> onExtensionEvent; |
| 33 final Stream<M.TimelineEventsEvent> onTimelineEvents; |
| 34 final Stream<M.ConnectionClosedEvent> onConnectionClosed; |
| 35 |
| 36 EventRepository() : this._(new StreamController.broadcast()); |
| 37 |
| 38 EventRepository._(StreamController controller) : this.__(controller, |
| 39 controller.stream.where((e) => e is M.VMEvent), |
| 40 controller.stream.where((e) => e is M.IsolateEvent), |
| 41 controller.stream.where((e) => e is M.DebugEvent), |
| 42 controller.stream.where((e) => e is M.GCEvent), |
| 43 controller.stream.where((e) => e is M.ExtensionEvent), |
| 44 controller.stream.where((e) => e is M.TimelineEventsEvent), |
| 45 controller.stream.where((e) => e is M.ConnectionClosedEvent)); |
| 46 |
| 47 EventRepository.__(StreamController controller, |
| 48 Stream<M.VMEvent> onVMEvent, Stream<M.IsolateEvent> onIsolateEvent, |
| 49 Stream<M.DebugEvent> onDebugEvent, Stream<M.GCEvent> onGCEvent, |
| 50 Stream<M.ExtensionEvent> onExtensionEvent, |
| 51 Stream<M.TimelineEventsEvent> onTimelineEvents, |
| 52 Stream<M.ConnectionClosedEvent> onConnectionClosed) |
| 53 : _onEvent = controller, |
| 54 onVMEvent = onVMEvent, |
| 55 onVMUpdate = onVMEvent.where((e) => e is M.VMUpdateEvent), |
| 56 onIsolateEvent = onIsolateEvent, |
| 57 onIsolateStart = onIsolateEvent.where((e) => e is M.IsolateStartEvent), |
| 58 onIsolateRunnable = |
| 59 onIsolateEvent.where((e) => e is M.IsolateRunnableEvent), |
| 60 onIsolateExit = onIsolateEvent.where((e) => e is M.IsolateExitEvent), |
| 61 onIsolateUpdate = onIsolateEvent.where((e) => e is M.IsolateUpdateEvent), |
| 62 onIsolateReload = onIsolateEvent.where((e) => e is M.IsolateReloadEvent), |
| 63 onServiceExtensionAdded = |
| 64 onIsolateEvent.where((e) => e is M.IsolateReloadEvent), |
| 65 onDebugEvent = onDebugEvent, |
| 66 onPauseStart = onDebugEvent.where((e) => e is M.PauseStartEvent), |
| 67 onPauseExit = onDebugEvent.where((e) => e is M.PauseExitEvent), |
| 68 onPauseBreakpoint = |
| 69 onDebugEvent.where((e) => e is M.PauseBreakpointEvent), |
| 70 onPauseInterrupted = |
| 71 onDebugEvent.where((e) => e is M.PauseInterruptedEvent), |
| 72 onPauseException = onDebugEvent.where((e) => e is M.PauseExceptionEvent), |
| 73 onResume = onDebugEvent.where((e) => e is M.ResumeEvent), |
| 74 onBreakpointAdded = |
| 75 onDebugEvent.where((e) => e is M.BreakpointAddedEvent), |
| 76 onBreakpointResolved = |
| 77 onDebugEvent.where((e) => e is M.BreakpointResolvedEvent), |
| 78 onBreakpointRemoved = |
| 79 onDebugEvent.where((e) => e is M.BreakpointRemovedEvent), |
| 80 onInspect = onDebugEvent.where((e) => e is M.InspectEvent), |
| 81 onGCEvent = onGCEvent, |
| 82 onExtensionEvent = onExtensionEvent, |
| 83 onTimelineEvents = onTimelineEvents, |
| 84 onConnectionClosed = onConnectionClosed; |
| 85 |
| 86 void add(M.Event e) { |
| 87 _onEvent.add(e); |
| 88 } |
| 89 } |
OLD | NEW |