Revert "inspector: defer JS execution from V8 interrupts" · nodejs/node@a284965 · GitHub
Skip to content

Commit a284965

Browse files
committed
Revert "inspector: defer JS execution from V8 interrupts"
This reverts commit 30f4990. PR-URL: #65907 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Richard Lau <richard.lau@ibm.com> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 8b52f14 commit a284965

3 files changed

Lines changed: 102 additions & 145 deletions

File tree

‎src/inspector_agent.cc‎

Lines changed: 84 additions & 99 deletions

‎src/inspector_agent.h‎

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,6 @@ class ParentInspectorHandle;
2828
class NodeInspectorClient;
2929
class WorkerManager;
3030

31-
struct JavaScriptHookState {
32-
bool wanted = false;
33-
bool enabled = false;
34-
bool syncing = false;
35-
};
36-
3731
class InspectorSession {
3832
public:
3933
virtual ~InspectorSession() = default;
@@ -138,7 +132,7 @@ class Agent {
138132

139133
private:
140134
void SyncAsyncHookState();
141-
void SyncNetworkTrackingState();
135+
void ToggleNetworkTracking(v8::Isolate* isolate, v8::Local<v8::Function> fn);
142136

143137
node::Environment* parent_env_;
144138
// Encapsulates majority of the Inspector functionality
@@ -158,11 +152,13 @@ class Agent {
158152
// The state of the async hook used for async stack traces that the protocol
159153
// last requested, and the state JS currently has. SyncAsyncHookState()
160154
// reconciles the two when it is possible and safe to call into JS.
161-
JavaScriptHookState async_hook_state_;
155+
bool async_hook_wanted_ = false;
156+
bool async_hook_enabled_ = false;
157+
bool syncing_async_hook_state_ = false;
162158

163-
// Network tracking uses JS hooks. Reconcile the protocol requested and
164-
// applied states after leaving a V8 interrupt.
165-
JavaScriptHookState network_tracking_state_;
159+
bool network_tracking_enabled_ = false;
160+
bool pending_enable_network_tracking = false;
161+
bool pending_disable_network_tracking = false;
166162
std::shared_ptr<NetworkResourceManager> network_resource_manager_;
167163
};
168164

‎src/inspector_js_api.cc‎

Lines changed: 11 additions & 35 deletions

0 commit comments

Comments
 (0)