Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2553)

Unified Diff: runtime/vm/service_event.h

Issue 979823003: Major rework of vm service events. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/service/service.idl ('k') | runtime/vm/service_event.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/service_event.h
diff --git a/runtime/vm/service_event.h b/runtime/vm/service_event.h
new file mode 100644
index 0000000000000000000000000000000000000000..b55d0a892eebabdb549b1f09d994edf3ea95604b
--- /dev/null
+++ b/runtime/vm/service_event.h
@@ -0,0 +1,91 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+#ifndef VM_SERVICE_EVENT_H_
+#define VM_SERVICE_EVENT_H_
+
+#include "vm/debugger.h"
+
+class DebuggerEvent;
+
+namespace dart {
+
+class ServiceEvent {
+ public:
+ enum EventType {
+ kIsolateStart, // New isolate has started
+ kIsolateExit, // Isolate has exited
+
+ kPauseStart, // --pause-isolates-on-start
+ kPauseExit, // --pause-isolates-on-exit
+ kPauseBreakpoint,
+ kPauseInterrupted,
+ kPauseException,
+ kResume,
+
+ kBreakpointAdded,
+ kBreakpointResolved,
+ kBreakpointRemoved,
+
+ kIllegal,
+ };
+
+ ServiceEvent(Isolate* isolate, EventType event_type)
+ : isolate_(isolate),
+ type_(event_type),
+ breakpoint_(NULL),
+ top_frame_(NULL),
+ exception_(NULL) {}
+
+ explicit ServiceEvent(const DebuggerEvent* debugger_event);
+
+ Isolate* isolate() const { return isolate_; }
+
+ EventType type() const { return type_; }
+
+ SourceBreakpoint* breakpoint() const {
+ return breakpoint_;
+ }
+ void set_breakpoint(SourceBreakpoint* bpt) {
+ ASSERT(type() == kPauseBreakpoint ||
+ type() == kBreakpointAdded ||
+ type() == kBreakpointResolved ||
+ type() == kBreakpointRemoved);
+ breakpoint_ = bpt;
+ }
+
+ ActivationFrame* top_frame() const {
+ return top_frame_;
+ }
+ void set_top_frame(ActivationFrame* frame) {
+ ASSERT(type() == kPauseBreakpoint ||
+ type() == kPauseInterrupted ||
+ type() == kPauseException ||
+ type() == kResume);
+ top_frame_ = frame;
+ }
+
+ const Object* exception() const {
+ return exception_;
+ }
+ void set_exception(const Object* exception) {
+ ASSERT(type_ == kPauseException);
+ exception_ = exception;
+ }
+
+ void PrintJSON(JSONStream* js) const;
+
+ static const char* EventTypeToCString(EventType type);
+
+ private:
+ Isolate* isolate_;
+ EventType type_;
+ SourceBreakpoint* breakpoint_;
+ ActivationFrame* top_frame_;
+ const Object* exception_;
+};
+
+} // namespace dart
+
+#endif // VM_SERVICE_EVENT_H_
« no previous file with comments | « runtime/vm/service/service.idl ('k') | runtime/vm/service_event.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698