| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/devtools/worker_devtools_agent_host.h" | 5 #include "content/browser/devtools/worker_devtools_agent_host.h" |
| 6 | 6 |
| 7 #include "base/guid.h" | 7 #include "base/guid.h" |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "content/browser/devtools/devtools_session.h" | 9 #include "content/browser/devtools/devtools_session.h" |
| 10 #include "content/browser/devtools/protocol/inspector_handler.h" | 10 #include "content/browser/devtools/protocol/inspector_handler.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 } | 32 } |
| 33 session->SetFallThroughForNotFound(true); | 33 session->SetFallThroughForNotFound(true); |
| 34 session->AddHandler(base::WrapUnique(new protocol::InspectorHandler())); | 34 session->AddHandler(base::WrapUnique(new protocol::InspectorHandler())); |
| 35 session->AddHandler(base::WrapUnique(new protocol::NetworkHandler())); | 35 session->AddHandler(base::WrapUnique(new protocol::NetworkHandler())); |
| 36 session->AddHandler(base::WrapUnique(new protocol::SchemaHandler())); | 36 session->AddHandler(base::WrapUnique(new protocol::SchemaHandler())); |
| 37 OnAttachedStateChanged(true); | 37 OnAttachedStateChanged(true); |
| 38 } | 38 } |
| 39 | 39 |
| 40 void WorkerDevToolsAgentHost::DetachSession(int session_id) { | 40 void WorkerDevToolsAgentHost::DetachSession(int session_id) { |
| 41 if (RenderProcessHost* host = RenderProcessHost::FromID(worker_id_.first)) | 41 if (RenderProcessHost* host = RenderProcessHost::FromID(worker_id_.first)) |
| 42 host->Send(new DevToolsAgentMsg_Detach(worker_id_.second)); | 42 host->Send(new DevToolsAgentMsg_Detach(worker_id_.second, session_id)); |
| 43 OnAttachedStateChanged(false); | 43 OnAttachedStateChanged(false); |
| 44 if (state_ == WORKER_INSPECTED) { | 44 if (state_ == WORKER_INSPECTED) { |
| 45 state_ = WORKER_UNINSPECTED; | 45 state_ = WORKER_UNINSPECTED; |
| 46 DetachFromWorker(); | 46 DetachFromWorker(); |
| 47 } else if (state_ == WORKER_PAUSED_FOR_REATTACH) { | 47 } else if (state_ == WORKER_PAUSED_FOR_REATTACH) { |
| 48 state_ = WORKER_UNINSPECTED; | 48 state_ = WORKER_UNINSPECTED; |
| 49 } | 49 } |
| 50 } | 50 } |
| 51 | 51 |
| 52 bool WorkerDevToolsAgentHost::DispatchProtocolMessage( | 52 bool WorkerDevToolsAgentHost::DispatchProtocolMessage( |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 | 166 |
| 167 void WorkerDevToolsAgentHost::OnDispatchOnInspectorFrontend( | 167 void WorkerDevToolsAgentHost::OnDispatchOnInspectorFrontend( |
| 168 const DevToolsMessageChunk& message) { | 168 const DevToolsMessageChunk& message) { |
| 169 if (!IsAttached()) | 169 if (!IsAttached()) |
| 170 return; | 170 return; |
| 171 | 171 |
| 172 chunk_processor_.ProcessChunkedMessageFromAgent(message); | 172 chunk_processor_.ProcessChunkedMessageFromAgent(message); |
| 173 } | 173 } |
| 174 | 174 |
| 175 } // namespace content | 175 } // namespace content |
| OLD | NEW |