| Index: third_party/WebKit/Source/web/WebDevToolsAgentImpl.cpp
|
| diff --git a/third_party/WebKit/Source/web/WebDevToolsAgentImpl.cpp b/third_party/WebKit/Source/web/WebDevToolsAgentImpl.cpp
|
| index 8fa45af76a799beac868704d12e590e10ff17ce0..5ac12e5ce172c30dd8a20e17b487b71cdba49526 100644
|
| --- a/third_party/WebKit/Source/web/WebDevToolsAgentImpl.cpp
|
| +++ b/third_party/WebKit/Source/web/WebDevToolsAgentImpl.cpp
|
| @@ -297,7 +297,8 @@ void WebDevToolsAgentImpl::WillBeDestroyed() {
|
| DCHECK(inspected_frames_->Root()->View());
|
| instrumenting_agents_->removeInspectorTraceEvents(trace_events_agent_);
|
| trace_events_agent_ = nullptr;
|
| - Detach();
|
| + if (session_)
|
| + Detach(session_->SessionId());
|
| resource_content_loader_->Dispose();
|
| client_ = nullptr;
|
| }
|
| @@ -428,8 +429,8 @@ void WebDevToolsAgentImpl::Reattach(const WebString& host_id,
|
| session_->Restore();
|
| }
|
|
|
| -void WebDevToolsAgentImpl::Detach() {
|
| - if (!Attached())
|
| +void WebDevToolsAgentImpl::Detach(int session_id) {
|
| + if (!Attached() || session_id != session_->SessionId())
|
| return;
|
| DestroySession();
|
| }
|
|
|