Skip to content

Commit 6c1e928

Browse files
committedFeb 13, 2019
worker: set up child Isolate inside Worker thread
Refs: #24016 PR-URL: #26011 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
1 parent 1764aae commit 6c1e928

File tree

4 files changed

+201
-172
lines changed

4 files changed

+201
-172
lines changed
 

‎src/inspector_agent.cc

+8-6
Original file line numberDiff line numberDiff line change
@@ -885,12 +885,14 @@ bool Agent::IsActive() {
885885
return io_ != nullptr || client_->IsActive();
886886
}
887887

888-
void Agent::AddWorkerInspector(int thread_id,
889-
const std::string& url,
890-
Agent* agent) {
891-
CHECK_NOT_NULL(client_);
892-
agent->parent_handle_ =
893-
client_->getWorkerManager()->NewParentHandle(thread_id, url);
888+
void Agent::SetParentHandle(
889+
std::unique_ptr<ParentInspectorHandle> parent_handle) {
890+
parent_handle_ = std::move(parent_handle);
891+
}
892+
893+
std::unique_ptr<ParentInspectorHandle> Agent::GetParentHandle(
894+
int thread_id, const std::string& url) {
895+
return client_->getWorkerManager()->NewParentHandle(thread_id, url);
894896
}
895897

896898
void Agent::WaitForConnect() {

‎src/inspector_agent.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ class Agent {
8585
void EnableAsyncHook();
8686
void DisableAsyncHook();
8787

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

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

0 commit comments

Comments
 (0)