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

Unified Diff: runtime/vm/message.h

Issue 9570046: Make the message queue private in the message handler. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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/isolate.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
===================================================================
--- runtime/vm/message.h (revision 4816)
+++ runtime/vm/message.h (working copy)
@@ -67,26 +67,16 @@
void Enqueue(Message* msg);
- // Gets the next message from the message queue, possibly blocking
- // if no message is available. 'millis' is a timeout in
- // milliseconds. If 'millis' is 0, then this means to block
- // indefinitely. May block if no message is available. May return
- // NULL even if 'millis' is 0 due to spurious wakeups.
- Message* Dequeue(int64_t millis);
+ // Gets the next message from the message queue if available.
+ // Returns NULL if no message is available.
+ Message* Dequeue();
- // Gets the next message from the message queue if available. Will
- // not block.
- Message* DequeueNoWait();
-
void Flush(Dart_Port port);
void FlushAll();
private:
friend class MessageQueueTestPeer;
- Message* DequeueNoWaitHoldsLock();
-
- Monitor monitor_;
Message* head_[Message::kNumPriorities];
Message* tail_[Message::kNumPriorities];
@@ -96,12 +86,11 @@
// A MessageHandler is an entity capable of accepting messages.
class MessageHandler {
protected:
- MessageHandler();
-
// Allows subclasses to provide custom message notification.
virtual void MessageNotify(Message::Priority priority);
public:
+ MessageHandler();
virtual ~MessageHandler();
// Allow subclasses to provide a handler name.
@@ -120,6 +109,17 @@
void ClosePort(Dart_Port port);
void CloseAllPorts();
+ // Gets the next message from the message queue, possibly blocking
+ // if no message is available. 'millis' is a timeout in
+ // milliseconds. If 'millis' is 0, then this means to block
+ // indefinitely. May block if no message is available. May return
+ // NULL even if 'millis' is 0 due to spurious wakeups.
+ Message* Dequeue(int64_t millis);
+
+ // Gets the next message from the message queue if available. Will
+ // not block.
+ Message* DequeueNoWait();
+
// A message handler tracks how many live ports it has.
bool HasLivePorts() const { return live_ports_ > 0; }
void increment_live_ports() {
@@ -140,9 +140,10 @@
// This is used to delete handlers when their last live port is closed.
virtual bool OwnedByPortMap() const { return false; }
- MessageQueue* queue() const { return queue_; }
+ private:
+ friend class MessageHandlerTestPeer;
- private:
+ Monitor monitor_;
intptr_t live_ports_;
MessageQueue* queue_;
};
« no previous file with comments | « runtime/vm/isolate.cc ('k') | runtime/vm/message.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698