Commit c25986a0 authored by Dmitry Gozman's avatar Dmitry Gozman Committed by Commit Bot

[DevTools] Do not allow DTAH to attach a single client twice

Attaching second time destroys the first session (by overriding it
in session_by_client_ map), and leaves stale pointers to it in
session_by_id_ and sessions_.

Bug: 774695
Change-Id: Ibb2dad0917adaf1c33bace4feef8e4fc5247f7c8
Reviewed-on: https://chromium-review.googlesource.com/719431Reviewed-by: default avatarPavel Feldman <pfeldman@chromium.org>
Commit-Queue: Dmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#509245}
parent 242fc1a3
......@@ -157,10 +157,14 @@ void DevToolsAgentHostImpl::InnerAttachClient(DevToolsAgentHostClient* client) {
}
void DevToolsAgentHostImpl::AttachClient(DevToolsAgentHostClient* client) {
if (SessionByClient(client))
return;
InnerAttachClient(client);
}
void DevToolsAgentHostImpl::ForceAttachClient(DevToolsAgentHostClient* client) {
if (SessionByClient(client))
return;
scoped_refptr<DevToolsAgentHostImpl> protect(this);
if (!sessions_.empty())
ForceDetachAllClients(true);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment