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

Unified Diff: runtime/vm/message.h

Issue 1122503003: Display isolate message queue in Observatory debugger (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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/json_stream.cc ('k') | runtime/vm/message.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/message.h
diff --git a/runtime/vm/message.h b/runtime/vm/message.h
index 3c08ae94ee3f7471cb7a3024b5e4e5db092c5441..42a1eb1e1a353a1bb681b27ba33b56aa29301d57 100644
--- a/runtime/vm/message.h
+++ b/runtime/vm/message.h
@@ -6,6 +6,7 @@
#define VM_MESSAGE_H_
#include "platform/assert.h"
+#include "vm/allocation.h"
#include "vm/globals.h"
// Duplicated from dart_api.h to avoid including the whole header.
@@ -13,6 +14,8 @@ typedef int64_t Dart_Port;
namespace dart {
+class JSONStream;
+
class Message {
public:
typedef enum {
@@ -68,6 +71,10 @@ class Message {
bool RedirectToDeliveryFailurePort();
+ intptr_t Id() const;
+
+ static const char* PriorityAsString(Priority priority);
+
private:
friend class MessageQueue;
@@ -98,6 +105,31 @@ class MessageQueue {
// Clear all messages from the message queue.
void Clear();
+ // Iterator class.
+ class Iterator : public ValueObject {
+ public:
+ explicit Iterator(const MessageQueue* queue);
+ virtual ~Iterator();
+
+ void Reset(const MessageQueue* queue);
+
+ // Returns false when there are no more messages left.
+ bool HasNext();
+
+ // Returns the current message and moves forward.
+ Message* Next();
+
+ private:
+ Message* next_;
+ };
+
+ intptr_t Length() const;
+
+ // Returns the message with id or NULL.
+ Message* FindMessageById(intptr_t id);
+
+ void PrintJSON(JSONStream* stream);
+
private:
Message* head_;
Message* tail_;
« no previous file with comments | « runtime/vm/json_stream.cc ('k') | runtime/vm/message.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698