-
Notifications
You must be signed in to change notification settings - Fork 30.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
inspector: supported NodeRuntime domain in worker #27706
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -115,6 +115,11 @@ DispatchResponse WorkerAgent::disable() { | |
return DispatchResponse::OK(); | ||
} | ||
|
||
DispatchResponse WorkerAgent::detach(const String& sessionId) { | ||
workers_->Detached(sessionId); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we really need a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes! It is how most domains (e.g. Target domain) in Chrome works. Notification means that worker session was detached for some reasons, one of the reasons might be explicit protocol request. It is easy to ignore this notification on frontend if needed. |
||
return DispatchResponse::OK(); | ||
} | ||
|
||
void NodeWorkers::WorkerCreated(const std::string& title, | ||
const std::string& url, | ||
bool waiting, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need
attach
for symmetry? The problem I see is that we do not track worker separately from a session so introducing attach would definitely make it more confusing...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case should we have a little bit crazy
NodeRuntime.disconnect
method that works for main and worker thread?I don't know any use case for
NodeWorker.attach
. Since workers are not waiting for attach by default, this method does not add any value withoutwaitForDebuggerOnStart
flag. Could we add it later when we know use case better?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One potential problem I see with the
detach
is that the worker is kind of "lost" once session is detached. A frontend may detach from the worker early and then there will be no way of attaching again. IMHO,attach
can be implemented later if needed.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't think this is necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feel free to ping me when someone would ask about this feature!