Skip to content
Merged
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
Prev Previous commit
Next Next commit
fixup! remove breaking change
  • Loading branch information
debadree25 committed Feb 28, 2023
commit 35811f5f59ffbef2b22e932be60b4b9efa92b62c
14 changes: 14 additions & 0 deletions src/api/environment.cc
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,20 @@ void FreeEnvironment(Environment* env) {
delete env;
}

NODE_EXTERN std::unique_ptr<InspectorParentHandle> GetInspectorParentHandle(
Environment* env,
ThreadId thread_id,
const char* url) {
CHECK_NOT_NULL(env);
CHECK_NE(thread_id.id, static_cast<uint64_t>(-1));
#if HAVE_INSPECTOR
return std::make_unique<InspectorParentHandleImpl>(
env->inspector_agent()->GetParentHandle(thread_id.id, url, ""));
#else
return {};
#endif
}
Comment thread
addaleax marked this conversation as resolved.

NODE_EXTERN std::unique_ptr<InspectorParentHandle> GetInspectorParentHandle(
Environment* env,
ThreadId thread_id,
Expand Down
5 changes: 5 additions & 0 deletions src/node.h
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,11 @@ NODE_EXTERN Environment* CreateEnvironment(
// Environment, together with the inspector handle.
// This method should not be called while the parent Environment is active
// on another thread.
NODE_EXTERN std::unique_ptr<InspectorParentHandle> GetInspectorParentHandle(
Environment* parent_env,
ThreadId child_thread_id,
const char* child_url);

NODE_EXTERN std::unique_ptr<InspectorParentHandle> GetInspectorParentHandle(
Environment* parent_env,
ThreadId child_thread_id,
Expand Down
2 changes: 1 addition & 1 deletion test/cctest/test_environment.cc
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ TEST_F(EnvironmentTest, InspectorMultipleEmbeddedEnvironments) {
ChildEnvironmentData data;
data.thread_id = node::AllocateEnvironmentThreadId();
data.inspector_parent_handle =
GetInspectorParentHandle(*env, data.thread_id, "file:///embedded.js", "");
GetInspectorParentHandle(*env, data.thread_id, "file:///embedded.js");
CHECK(data.inspector_parent_handle);
data.platform = GetMultiIsolatePlatform(*env);
CHECK_NOT_NULL(data.platform);
Expand Down