| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/debugger/worker_devtools_manager.h" | 5 #include "content/browser/debugger/worker_devtools_manager.h" |
| 6 | 6 |
| 7 #include <list> | 7 #include <list> |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 | 159 |
| 160 static void WorkerDestroyed(WorkerId id) { | 160 static void WorkerDestroyed(WorkerId id) { |
| 161 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 161 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 162 WorkerDevToolsAgentHost* agent = AgentHosts::GetAgentHost(id); | 162 WorkerDevToolsAgentHost* agent = AgentHosts::GetAgentHost(id); |
| 163 if (!agent) { | 163 if (!agent) { |
| 164 RemovePendingWorkerData(id); | 164 RemovePendingWorkerData(id); |
| 165 return; | 165 return; |
| 166 } | 166 } |
| 167 DevToolsManagerImpl::GetInstance()->DispatchOnInspectorFrontend( | 167 DevToolsManagerImpl::GetInstance()->DispatchOnInspectorFrontend( |
| 168 agent, | 168 agent, |
| 169 WebKit::WebDevToolsAgent::disconnectEventAsText().utf8()); | 169 WebKit::WebDevToolsAgent::workerDisconnectedFromWorkerEvent().utf8()); |
| 170 int cookie = DevToolsManagerImpl::GetInstance()->DetachClientHost(agent); | 170 int cookie = DevToolsManagerImpl::GetInstance()->DetachClientHost(agent); |
| 171 agent->WorkerDestroyed(); | 171 agent->WorkerDestroyed(); |
| 172 if (cookie == -1) { | 172 if (cookie == -1) { |
| 173 RemovePendingWorkerData(id); | 173 RemovePendingWorkerData(id); |
| 174 return; | 174 return; |
| 175 } | 175 } |
| 176 if (!instance_) | 176 if (!instance_) |
| 177 new DetachedClientHosts(); | 177 new DetachedClientHosts(); |
| 178 instance_->worker_id_to_cookie_[id] = cookie; | 178 instance_->worker_id_to_cookie_[id] = cookie; |
| 179 } | 179 } |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 host->WorkerDestroyed(); | 463 host->WorkerDestroyed(); |
| 464 } | 464 } |
| 465 | 465 |
| 466 // static | 466 // static |
| 467 void WorkerDevToolsManager::SendResumeToWorker(const WorkerId& id) { | 467 void WorkerDevToolsManager::SendResumeToWorker(const WorkerId& id) { |
| 468 if (WorkerProcessHost* process = FindWorkerProcess(id.first)) | 468 if (WorkerProcessHost* process = FindWorkerProcess(id.first)) |
| 469 process->Send(new DevToolsAgentMsg_ResumeWorkerContext(id.second)); | 469 process->Send(new DevToolsAgentMsg_ResumeWorkerContext(id.second)); |
| 470 } | 470 } |
| 471 | 471 |
| 472 } // namespace content | 472 } // namespace content |
| OLD | NEW |