Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Side by Side Diff: content/browser/debugger/worker_devtools_manager.cc

Issue 10989012: Destroy WorkerDevToolsAgentHost when corresponding worker terminates (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698