| Index: runtime/vm/service_event.cc
|
| diff --git a/runtime/vm/service_event.cc b/runtime/vm/service_event.cc
|
| index 9c9868a933e6e5b484e1711fa3d29fbaea05daac..42dd2022f53e4197148edebd27d1afa1538bb893 100644
|
| --- a/runtime/vm/service_event.cc
|
| +++ b/runtime/vm/service_event.cc
|
| @@ -4,6 +4,8 @@
|
|
|
| #include "vm/service_event.h"
|
|
|
| +#include "vm/message_handler.h"
|
| +
|
| namespace dart {
|
|
|
| // Translate from the legacy DebugEvent to a ServiceEvent.
|
| @@ -30,6 +32,31 @@ static ServiceEvent::EventKind TranslateEventKind(
|
| }
|
| }
|
|
|
| +
|
| +ServiceEvent::ServiceEvent(Isolate* isolate, EventKind event_kind)
|
| + : isolate_(isolate),
|
| + kind_(event_kind),
|
| + embedder_kind_(NULL),
|
| + embedder_stream_id_(NULL),
|
| + breakpoint_(NULL),
|
| + top_frame_(NULL),
|
| + exception_(NULL),
|
| + async_continuation_(NULL),
|
| + at_async_jump_(false),
|
| + inspectee_(NULL),
|
| + gc_stats_(NULL),
|
| + bytes_(NULL),
|
| + bytes_length_(0),
|
| + timestamp_(OS::GetCurrentTimeMillis()) {
|
| + if ((event_kind == ServiceEvent::kPauseStart) ||
|
| + (event_kind == ServiceEvent::kPauseExit)) {
|
| + timestamp_ = isolate->message_handler()->paused_timestamp();
|
| + } else if (event_kind == ServiceEvent::kResume) {
|
| + timestamp_ = isolate->last_resume_timestamp();
|
| + }
|
| +}
|
| +
|
| +
|
| ServiceEvent::ServiceEvent(const DebuggerEvent* debugger_event)
|
| : isolate_(debugger_event->isolate()),
|
| kind_(TranslateEventKind(debugger_event->type())),
|
| @@ -40,7 +67,8 @@ ServiceEvent::ServiceEvent(const DebuggerEvent* debugger_event)
|
| inspectee_(NULL),
|
| gc_stats_(NULL),
|
| bytes_(NULL),
|
| - bytes_length_(0) {
|
| + bytes_length_(0),
|
| + timestamp_(OS::GetCurrentTimeMillis()) {
|
| DebuggerEvent::EventType type = debugger_event->type();
|
| if (type == DebuggerEvent::kBreakpointReached) {
|
| set_breakpoint(debugger_event->breakpoint());
|
| @@ -55,6 +83,9 @@ ServiceEvent::ServiceEvent(const DebuggerEvent* debugger_event)
|
| type == DebuggerEvent::kExceptionThrown) {
|
| set_top_frame(debugger_event->top_frame());
|
| }
|
| + if (debugger_event->timestamp() != -1) {
|
| + timestamp_ = debugger_event->timestamp();
|
| + }
|
| }
|
|
|
|
|
| @@ -204,6 +235,8 @@ void ServiceEvent::PrintJSONHeader(JSONObject* jsobj) const {
|
| jsobj->AddProperty("type", "Event");
|
| jsobj->AddProperty("kind", KindAsCString());
|
| jsobj->AddProperty("isolate", isolate());
|
| + ASSERT(timestamp_ != -1);
|
| + jsobj->AddPropertyTimeMillis("timestamp", timestamp_);
|
| }
|
|
|
| } // namespace dart
|
|
|