Index: runtime/vm/service_event.h |
diff --git a/runtime/vm/service_event.h b/runtime/vm/service_event.h |
index 7a5a8baa7842d7bf06da9d664198278cf2ac60d4..e72fbceb12110837476dd45d0ba8e842f0b85fdd 100644 |
--- a/runtime/vm/service_event.h |
+++ b/runtime/vm/service_event.h |
@@ -13,7 +13,7 @@ namespace dart { |
class ServiceEvent { |
public: |
- enum EventType { |
+ enum EventKind { |
kIsolateStart, // New isolate has started |
kIsolateExit, // Isolate has exited |
kIsolateUpdate, // Isolate identity information has changed |
@@ -32,34 +32,52 @@ class ServiceEvent { |
kGC, |
+ kEmbedder, |
+ |
kIllegal, |
}; |
- ServiceEvent(Isolate* isolate, EventType event_type) |
+ ServiceEvent(Isolate* isolate, EventKind event_kind) |
: isolate_(isolate), |
- type_(event_type), |
+ kind_(event_kind), |
+ embedder_kind_(NULL), |
+ embedder_stream_id_(NULL), |
breakpoint_(NULL), |
top_frame_(NULL), |
exception_(NULL), |
inspectee_(NULL), |
- gc_stats_(NULL) {} |
+ gc_stats_(NULL), |
+ bytes_(NULL), |
+ bytes_length_(0) {} |
explicit ServiceEvent(const DebuggerEvent* debugger_event); |
Isolate* isolate() const { return isolate_; } |
- EventType type() const { return type_; } |
+ EventKind kind() const { return kind_; } |
+ |
+ const char* embedder_kind() const { return embedder_kind_; } |
+ |
+ const char* KindAsCString() const; |
+ |
+ void set_embedder_kind(const char* embedder_kind) { |
+ embedder_kind_ = embedder_kind; |
+ } |
const char* stream_id() const; |
+ void set_embedder_stream_id(const char* stream_id) { |
+ embedder_stream_id_ = stream_id; |
+ } |
+ |
Breakpoint* breakpoint() const { |
return breakpoint_; |
} |
void set_breakpoint(Breakpoint* bpt) { |
- ASSERT(type() == kPauseBreakpoint || |
- type() == kBreakpointAdded || |
- type() == kBreakpointResolved || |
- type() == kBreakpointRemoved); |
+ ASSERT(kind() == kPauseBreakpoint || |
+ kind() == kBreakpointAdded || |
+ kind() == kBreakpointResolved || |
+ kind() == kBreakpointRemoved); |
breakpoint_ = bpt; |
} |
@@ -67,10 +85,10 @@ class ServiceEvent { |
return top_frame_; |
} |
void set_top_frame(ActivationFrame* frame) { |
- ASSERT(type() == kPauseBreakpoint || |
- type() == kPauseInterrupted || |
- type() == kPauseException || |
- type() == kResume); |
+ ASSERT(kind() == kPauseBreakpoint || |
+ kind() == kPauseInterrupted || |
+ kind() == kPauseException || |
+ kind() == kResume); |
top_frame_ = frame; |
} |
@@ -78,7 +96,7 @@ class ServiceEvent { |
return exception_; |
} |
void set_exception(const Object* exception) { |
- ASSERT(type_ == kPauseException); |
+ ASSERT(kind_ == kPauseException); |
exception_ = exception; |
} |
@@ -86,7 +104,7 @@ class ServiceEvent { |
return inspectee_; |
} |
void set_inspectee(const Object* inspectee) { |
- ASSERT(type_ == kInspect); |
+ ASSERT(kind_ == kInspect); |
inspectee_ = inspectee; |
} |
@@ -98,18 +116,33 @@ class ServiceEvent { |
gc_stats_ = gc_stats; |
} |
- void PrintJSON(JSONStream* js) const; |
+ const uint8_t* bytes() const { |
+ return bytes_; |
+ } |
+ |
+ intptr_t bytes_length() const { |
+ return bytes_length_; |
+ } |
- static const char* EventTypeToCString(EventType type); |
+ void set_bytes(const uint8_t* bytes, intptr_t bytes_length) { |
+ bytes_ = bytes; |
+ bytes_length_ = bytes_length; |
+ } |
+ |
+ void PrintJSON(JSONStream* js) const; |
private: |
Isolate* isolate_; |
- EventType type_; |
+ EventKind kind_; |
+ const char* embedder_kind_; |
+ const char* embedder_stream_id_; |
Breakpoint* breakpoint_; |
ActivationFrame* top_frame_; |
const Object* exception_; |
const Object* inspectee_; |
const Heap::GCStats* gc_stats_; |
+ const uint8_t* bytes_; |
+ intptr_t bytes_length_; |
}; |
} // namespace dart |