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

Unified Diff: runtime/vm/message_handler.h

Issue 1665773004: Add necessary support functions so that embedders can implemented pause on start and exit (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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
Index: runtime/vm/message_handler.h
diff --git a/runtime/vm/message_handler.h b/runtime/vm/message_handler.h
index f4d907ca8765c0a0bb3cdd1ce0b801cd40d4cab4..d1ed89b1ede5c70bc4860992dfe7fa6dec2e65ff 100644
--- a/runtime/vm/message_handler.h
+++ b/runtime/vm/message_handler.h
@@ -56,6 +56,13 @@ class MessageHandler {
// Returns true on success.
MessageStatus HandleNextMessage();
+ // Handles all normals messages for this message handler. Should only
turnidge 2016/02/03 21:33:37 Delete "normals". This functions actually handles
Cutch 2016/02/03 23:04:05 Done.
+ // be used when not running the handler on the thread pool (via Run
+ // or RunBlocking).
+ //
+ // Returns true on success.
+ MessageStatus HandleNormalMessages();
+
// Handles any OOB messages for this message handler. Can be used
// even if the message handler is running on the thread pool.
//
@@ -109,6 +116,9 @@ class MessageHandler {
return paused_timestamp_;
}
+ void PausedOnStart(bool v);
+ void PausedOnExit(bool v);
+
class AcquiredQueues : public ValueObject {
public:
AcquiredQueues();
@@ -151,6 +161,9 @@ class MessageHandler {
virtual void CheckAccess();
#endif
+ virtual void NotifyPauseOnStart() {}
+ virtual void NotifyPauseOnExit() {}
+
protected:
// ------------ START PortMap API ------------
// These functions should only be called from the PortMap.
@@ -189,9 +202,6 @@ class MessageHandler {
// Returns true on success.
virtual MessageStatus HandleMessage(Message* message) = 0;
- virtual void NotifyPauseOnStart() {}
- virtual void NotifyPauseOnExit() {}
-
// TODO(iposva): Set a local field before entering MessageHandler methods.
Thread* thread() const { return Thread::Current(); }
@@ -203,6 +213,9 @@ class MessageHandler {
// Called by MessageHandlerTask to process our task queue.
void TaskCallback();
+ void PausedOnStartLocked(bool v);
+ void PausedOnExitLocked(bool v);
+
// Dequeue the next message. Prefer messages from the oob_queue_ to
// messages from the queue_.
Message* DequeueMessage(Message::Priority min_priority);

Powered by Google App Engine
This is Rietveld 408576698