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 import 'package:logging/logging.dart'; | 5 import 'package:logging/logging.dart'; |
6 import 'package:observatory/models.dart' as M; | 6 import 'package:observatory/models.dart' as M; |
7 import 'package:observatory/service.dart' as S; | 7 import 'package:observatory/service.dart' as S; |
8 | 8 |
9 class VMUpdateEvent implements M.VMUpdateEvent { | 9 class VMUpdateEvent implements M.VMUpdateEvent { |
10 final DateTime timestamp; | 10 final DateTime timestamp; |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 final M.Frame topFrame; | 131 final M.Frame topFrame; |
132 final bool atAsyncSuspension; | 132 final bool atAsyncSuspension; |
133 PauseInterruptedEvent( | 133 PauseInterruptedEvent( |
134 this.timestamp, this.isolate, this.topFrame, this.atAsyncSuspension) { | 134 this.timestamp, this.isolate, this.topFrame, this.atAsyncSuspension) { |
135 assert(timestamp != null); | 135 assert(timestamp != null); |
136 assert(isolate != null); | 136 assert(isolate != null); |
137 assert(atAsyncSuspension != null); | 137 assert(atAsyncSuspension != null); |
138 } | 138 } |
139 } | 139 } |
140 | 140 |
141 | |
142 class PausePostRequestEvent implements M.PausePostRequestEvent { | 141 class PausePostRequestEvent implements M.PausePostRequestEvent { |
143 final DateTime timestamp; | 142 final DateTime timestamp; |
144 final M.IsolateRef isolate; | 143 final M.IsolateRef isolate; |
145 final M.Frame topFrame; | 144 final M.Frame topFrame; |
146 final bool atAsyncSuspension; | 145 final bool atAsyncSuspension; |
147 PausePostRequestEvent( | 146 PausePostRequestEvent( |
148 this.timestamp, this.isolate, this.topFrame, this.atAsyncSuspension) { | 147 this.timestamp, this.isolate, this.topFrame, this.atAsyncSuspension) { |
149 assert(timestamp != null); | 148 assert(timestamp != null); |
150 assert(isolate != null); | 149 assert(isolate != null); |
151 assert(atAsyncSuspension != null); | 150 assert(atAsyncSuspension != null); |
152 } | 151 } |
153 } | 152 } |
154 | 153 |
155 | |
156 class PauseExceptionEvent implements M.PauseExceptionEvent { | 154 class PauseExceptionEvent implements M.PauseExceptionEvent { |
157 final DateTime timestamp; | 155 final DateTime timestamp; |
158 final M.IsolateRef isolate; | 156 final M.IsolateRef isolate; |
159 final M.Frame topFrame; | 157 final M.Frame topFrame; |
160 final M.InstanceRef exception; | 158 final M.InstanceRef exception; |
161 PauseExceptionEvent( | 159 PauseExceptionEvent( |
162 this.timestamp, this.isolate, this.topFrame, this.exception) { | 160 this.timestamp, this.isolate, this.topFrame, this.exception) { |
163 assert(timestamp != null); | 161 assert(timestamp != null); |
164 assert(isolate != null); | 162 assert(isolate != null); |
165 assert(topFrame != null); | 163 assert(topFrame != null); |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 event.timestamp, event.isolate, event.breakpoint); | 310 event.timestamp, event.isolate, event.breakpoint); |
313 case S.ServiceEvent.kDebuggerSettingsUpdate: | 311 case S.ServiceEvent.kDebuggerSettingsUpdate: |
314 return new DebuggerSettingsUpdateEvent(event.timestamp, event.isolate); | 312 return new DebuggerSettingsUpdateEvent(event.timestamp, event.isolate); |
315 case S.ServiceEvent.kResume: | 313 case S.ServiceEvent.kResume: |
316 return new ResumeEvent(event.timestamp, event.isolate, event.topFrame); | 314 return new ResumeEvent(event.timestamp, event.isolate, event.topFrame); |
317 case S.ServiceEvent.kPauseStart: | 315 case S.ServiceEvent.kPauseStart: |
318 return new PauseStartEvent(event.timestamp, event.isolate); | 316 return new PauseStartEvent(event.timestamp, event.isolate); |
319 case S.ServiceEvent.kPauseExit: | 317 case S.ServiceEvent.kPauseExit: |
320 return new PauseExitEvent(event.timestamp, event.isolate); | 318 return new PauseExitEvent(event.timestamp, event.isolate); |
321 case S.ServiceEvent.kPausePostRequest: | 319 case S.ServiceEvent.kPausePostRequest: |
322 return new PausePostRequestEvent( | 320 return new PausePostRequestEvent(event.timestamp, event.isolate, |
323 event.timestamp, | 321 event.topFrame, event.atAsyncSuspension); |
324 event.isolate, | |
325 event.topFrame, | |
326 event.atAsyncSuspension); | |
327 case S.ServiceEvent.kPauseBreakpoint: | 322 case S.ServiceEvent.kPauseBreakpoint: |
328 return new PauseBreakpointEvent( | 323 return new PauseBreakpointEvent( |
329 event.timestamp, | 324 event.timestamp, |
330 event.isolate, | 325 event.isolate, |
331 event.pauseBreakpoints, | 326 event.pauseBreakpoints, |
332 event.topFrame, | 327 event.topFrame, |
333 event.atAsyncSuspension, | 328 event.atAsyncSuspension, |
334 event.breakpoint); | 329 event.breakpoint); |
335 case S.Isolate.kLoggingStream: | 330 case S.Isolate.kLoggingStream: |
336 return new LoggingEvent(event.timestamp, event.isolate, event.logRecord); | 331 return new LoggingEvent(event.timestamp, event.isolate, event.logRecord); |
337 case S.ServiceEvent.kPauseInterrupted: | 332 case S.ServiceEvent.kPauseInterrupted: |
338 return new PauseInterruptedEvent(event.timestamp, event.isolate, | 333 return new PauseInterruptedEvent(event.timestamp, event.isolate, |
339 event.topFrame, event.atAsyncSuspension); | 334 event.topFrame, event.atAsyncSuspension); |
340 case S.ServiceEvent.kPauseException: | 335 case S.ServiceEvent.kPauseException: |
341 return new PauseExceptionEvent( | 336 return new PauseExceptionEvent( |
342 event.timestamp, event.isolate, event.topFrame, event.exception); | 337 event.timestamp, event.isolate, event.topFrame, event.exception); |
343 case S.ServiceEvent.kInspect: | 338 case S.ServiceEvent.kInspect: |
344 return new InspectEvent(event.timestamp, event.isolate, event.inspectee); | 339 return new InspectEvent(event.timestamp, event.isolate, event.inspectee); |
345 case S.ServiceEvent.kGC: | 340 case S.ServiceEvent.kGC: |
346 return new GCEvent(event.timestamp, event.isolate); | 341 return new GCEvent(event.timestamp, event.isolate); |
347 case S.ServiceEvent.kNone: | 342 case S.ServiceEvent.kNone: |
348 return new NoneEvent(event.timestamp, event.isolate); | 343 return new NoneEvent(event.timestamp, event.isolate); |
349 default: | 344 default: |
350 // Ignore unrecognized events. | 345 // Ignore unrecognized events. |
351 Logger.root.severe('Unrecognized event: $event'); | 346 Logger.root.severe('Unrecognized event: $event'); |
352 return null; | 347 return null; |
353 } | 348 } |
354 } | 349 } |
OLD | NEW |