| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 #include "vm/service_event.h" | 5 #include "vm/service_event.h" |
| 6 | 6 |
| 7 #include "vm/message_handler.h" | 7 #include "vm/message_handler.h" |
| 8 | 8 |
| 9 namespace dart { | 9 namespace dart { |
| 10 | 10 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 top_frame_(NULL), | 44 top_frame_(NULL), |
| 45 timeline_event_block_(NULL), | 45 timeline_event_block_(NULL), |
| 46 extension_rpc_(NULL), | 46 extension_rpc_(NULL), |
| 47 exception_(NULL), | 47 exception_(NULL), |
| 48 at_async_jump_(false), | 48 at_async_jump_(false), |
| 49 inspectee_(NULL), | 49 inspectee_(NULL), |
| 50 gc_stats_(NULL), | 50 gc_stats_(NULL), |
| 51 bytes_(NULL), | 51 bytes_(NULL), |
| 52 bytes_length_(0), | 52 bytes_length_(0), |
| 53 timestamp_(OS::GetCurrentTimeMillis()) { | 53 timestamp_(OS::GetCurrentTimeMillis()) { |
| 54 if ((event_kind == ServiceEvent::kPauseStart) || | 54 if ((event_kind == ServiceEvent::kPauseStart) && |
| 55 (event_kind == ServiceEvent::kPauseExit)) { | 55 !isolate->message_handler()->is_paused_on_start()) { |
| 56 // We will pause on start but the message handler lacks a valid |
| 57 // paused timestamp because we haven't paused yet. Use the current time. |
| 58 timestamp_ = OS::GetCurrentTimeMillis(); |
| 59 } else if ((event_kind == ServiceEvent::kPauseStart) || |
| 60 (event_kind == ServiceEvent::kPauseExit)) { |
| 56 timestamp_ = isolate->message_handler()->paused_timestamp(); | 61 timestamp_ = isolate->message_handler()->paused_timestamp(); |
| 57 } else if (event_kind == ServiceEvent::kResume) { | 62 } else if (event_kind == ServiceEvent::kResume) { |
| 58 timestamp_ = isolate->last_resume_timestamp(); | 63 timestamp_ = isolate->last_resume_timestamp(); |
| 59 } | 64 } |
| 60 } | 65 } |
| 61 | 66 |
| 62 | 67 |
| 63 ServiceEvent::ServiceEvent(const DebuggerEvent* debugger_event) | 68 ServiceEvent::ServiceEvent(const DebuggerEvent* debugger_event) |
| 64 : isolate_(debugger_event->isolate()), | 69 : isolate_(debugger_event->isolate()), |
| 65 kind_(TranslateEventKind(debugger_event->type())), | 70 kind_(TranslateEventKind(debugger_event->type())), |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 } else { | 284 } else { |
| 280 jsobj->AddProperty("isolate", isolate()); | 285 jsobj->AddProperty("isolate", isolate()); |
| 281 } | 286 } |
| 282 ASSERT(timestamp_ != -1); | 287 ASSERT(timestamp_ != -1); |
| 283 jsobj->AddPropertyTimeMillis("timestamp", timestamp_); | 288 jsobj->AddPropertyTimeMillis("timestamp", timestamp_); |
| 284 } | 289 } |
| 285 | 290 |
| 286 #endif // !PRODUCT | 291 #endif // !PRODUCT |
| 287 | 292 |
| 288 } // namespace dart | 293 } // namespace dart |
| OLD | NEW |