| 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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 176 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 177 WorkerDevToolsAgentHost* agent = AgentHosts::GetAgentHost(id); | 177 WorkerDevToolsAgentHost* agent = AgentHosts::GetAgentHost(id); |
| 178 if (!agent) { | 178 if (!agent) { |
| 179 RemovePendingWorkerData(id); | 179 RemovePendingWorkerData(id); |
| 180 return; | 180 return; |
| 181 } | 181 } |
| 182 DevToolsManagerImpl::GetInstance()->DispatchOnInspectorFrontend( | 182 DevToolsManagerImpl::GetInstance()->DispatchOnInspectorFrontend( |
| 183 agent, | 183 agent, |
| 184 WebKit::WebDevToolsAgent::disconnectEventAsText().utf8()); | 184 WebKit::WebDevToolsAgent::disconnectEventAsText().utf8()); |
| 185 int cookie = DevToolsManagerImpl::GetInstance()->DetachClientHost(agent); | 185 int cookie = DevToolsManagerImpl::GetInstance()->DetachClientHost(agent); |
| 186 agent->WorkerDestroyed(); |
| 186 if (cookie == -1) { | 187 if (cookie == -1) { |
| 187 RemovePendingWorkerData(id); | 188 RemovePendingWorkerData(id); |
| 188 return; | 189 return; |
| 189 } | 190 } |
| 190 if (!instance_) | 191 if (!instance_) |
| 191 new DetachedClientHosts(); | 192 new DetachedClientHosts(); |
| 192 instance_->worker_id_to_cookie_[id] = cookie; | 193 instance_->worker_id_to_cookie_[id] = cookie; |
| 193 } | 194 } |
| 194 | 195 |
| 195 private: | 196 private: |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 host->WorkerDestroyed(); | 490 host->WorkerDestroyed(); |
| 490 } | 491 } |
| 491 | 492 |
| 492 // static | 493 // static |
| 493 void WorkerDevToolsManager::SendResumeToWorker(const WorkerId& id) { | 494 void WorkerDevToolsManager::SendResumeToWorker(const WorkerId& id) { |
| 494 if (WorkerProcessHost* process = FindWorkerProcess(id.first)) | 495 if (WorkerProcessHost* process = FindWorkerProcess(id.first)) |
| 495 process->Send(new DevToolsAgentMsg_ResumeWorkerContext(id.second)); | 496 process->Send(new DevToolsAgentMsg_ResumeWorkerContext(id.second)); |
| 496 } | 497 } |
| 497 | 498 |
| 498 } // namespace | 499 } // namespace |
| OLD | NEW |