Skip to content
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

worker: set up child Isolate inside Worker thread #26011

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions src/inspector_agent.cc
Original file line number Diff line number Diff line change
Expand Up @@ -885,12 +885,14 @@ bool Agent::IsActive() {
return io_ != nullptr || client_->IsActive();
}

void Agent::AddWorkerInspector(int thread_id,
const std::string& url,
Agent* agent) {
CHECK_NOT_NULL(client_);
agent->parent_handle_ =
client_->getWorkerManager()->NewParentHandle(thread_id, url);
void Agent::SetParentHandle(
std::unique_ptr<ParentInspectorHandle> parent_handle) {
parent_handle_ = std::move(parent_handle);
}

std::unique_ptr<ParentInspectorHandle> Agent::GetParentHandle(
int thread_id, const std::string& url) {
return client_->getWorkerManager()->NewParentHandle(thread_id, url);
}

void Agent::WaitForConnect() {
Expand Down
4 changes: 3 additions & 1 deletion src/inspector_agent.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ class Agent {
void EnableAsyncHook();
void DisableAsyncHook();

void AddWorkerInspector(int thread_id, const std::string& url, Agent* agent);
void SetParentHandle(std::unique_ptr<ParentInspectorHandle> parent_handle);
std::unique_ptr<ParentInspectorHandle> GetParentHandle(
int thread_id, const std::string& url);

// Called to create inspector sessions that can be used from the main thread.
// The inspector responds by using the delegate to send messages back.
Expand Down
Loading