diff options
author | Eugene Ostroukhov <eostroukhov@chromium.org> | 2018-04-24 21:16:55 +0300 |
---|---|---|
committer | Eugene Ostroukhov <eostroukhov@google.com> | 2018-04-26 22:48:48 +0300 |
commit | 13001035340d6d3fb173fef4a1db42ba70f61720 (patch) | |
tree | 7333699fc80f90725a00b229dccc5bf718cfea78 /src/inspector_socket_server.cc | |
parent | 5c57cea8049bad5939807e6b849ee303ec8e1526 (diff) |
inspector: allow concurrent inspector sessions
This change enables concurrent inspector sessions, through WebSocket
interface as well as JS interface, in any combination.
PR-URL: https://github.com/nodejs/node/pull/20137
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'src/inspector_socket_server.cc')
-rw-r--r-- | src/inspector_socket_server.cc | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/src/inspector_socket_server.cc b/src/inspector_socket_server.cc index e69c8d768be..e890f66a38b 100644 --- a/src/inspector_socket_server.cc +++ b/src/inspector_socket_server.cc @@ -373,27 +373,17 @@ void InspectorSocketServer::SendListResponse(InspectorSocket* socket, target_map["url"] = delegate_->GetTargetUrl(id); Escape(&target_map["url"]); - bool connected = false; - for (const auto& session : connected_sessions_) { - if (session.second.first == id) { - connected = true; - break; - } - } - if (!connected) { - std::string detected_host = host; - if (detected_host.empty()) { - detected_host = FormatHostPort(socket->GetHost(), - session->server_port()); - } - std::ostringstream frontend_url; - frontend_url << "chrome-devtools://devtools/bundled"; - frontend_url << "/inspector.html?experiments=true&v8only=true&ws="; - frontend_url << FormatAddress(detected_host, id, false); - target_map["devtoolsFrontendUrl"] += frontend_url.str(); - target_map["webSocketDebuggerUrl"] = - FormatAddress(detected_host, id, true); + std::string detected_host = host; + if (detected_host.empty()) { + detected_host = FormatHostPort(socket->GetHost(), + session->server_port()); } + std::ostringstream frontend_url; + frontend_url << "chrome-devtools://devtools/bundled"; + frontend_url << "/inspector.html?experiments=true&v8only=true&ws="; + frontend_url << FormatAddress(detected_host, id, false); + target_map["devtoolsFrontendUrl"] += frontend_url.str(); + target_map["webSocketDebuggerUrl"] = FormatAddress(detected_host, id, true); } SendHttpResponse(socket, MapsToString(response)); } |