diff options
author | Eugene Ostroukhov <eostroukhov@chromium.org> | 2017-05-31 15:14:52 -0700 |
---|---|---|
committer | Eugene Ostroukhov <eostroukhov@chromium.org> | 2017-06-05 08:47:43 -0700 |
commit | e6dcc3dfa9dbbf59cf6f67425e47c47bea70fe2c (patch) | |
tree | 1b34b15cf54eba71bf5e3f21aa16d6e5c4ada01a /src/inspector_io.h | |
parent | 5d9dc94509253845642e617f9d6d47ce0d09d7da (diff) | |
download | node-new-e6dcc3dfa9dbbf59cf6f67425e47c47bea70fe2c.tar.gz |
inspector: Allows reentry when paused
This change allows reentering the message dispatch loop when the Node is
paused. This is necessary when the pause happened as a result of the
message sent by a debug frontend, such as evaluating a function with a
breakpoint inside.
Fixes: https://github.com/nodejs/node/issues/13320
PR-URL: https://github.com/nodejs/node/pull/13350
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/inspector_io.h')
-rw-r--r-- | src/inspector_io.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/inspector_io.h b/src/inspector_io.h index 6c9c2d2664..9ea1e0a785 100644 --- a/src/inspector_io.h +++ b/src/inspector_io.h @@ -6,9 +6,9 @@ #include "node_mutex.h" #include "uv.h" +#include <deque> #include <memory> #include <stddef.h> -#include <vector> #if !HAVE_INSPECTOR #error("This header can only be used when inspector is enabled") @@ -76,7 +76,7 @@ class InspectorIo { private: template <typename Action> using MessageQueue = - std::vector<std::tuple<Action, int, + std::deque<std::tuple<Action, int, std::unique_ptr<v8_inspector::StringBuffer>>>; enum class State { kNew, @@ -115,7 +115,7 @@ class InspectorIo { void SwapBehindLock(MessageQueue<ActionType>* vector1, MessageQueue<ActionType>* vector2); // Wait on incoming_message_cond_ - void WaitForIncomingMessage(); + void WaitForFrontendMessageWhilePaused(); // Broadcast incoming_message_cond_ void NotifyMessageReceived(); @@ -145,6 +145,7 @@ class InspectorIo { Mutex state_lock_; // Locked before mutating either queue. MessageQueue<InspectorAction> incoming_message_queue_; MessageQueue<TransportAction> outgoing_message_queue_; + MessageQueue<InspectorAction> dispatching_message_queue_; bool dispatching_messages_; int session_id_; |