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

Side by Side Diff: content/browser/devtools/service_worker_devtools_manager.cc

Issue 1071603006: Fix the browser crash in reattaching ServiceWorker to existing DevTools window. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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
« 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 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/service_worker_devtools_manager.h" 5 #include "content/browser/devtools/service_worker_devtools_manager.h"
6 6
7 #include "content/browser/devtools/devtools_manager.h" 7 #include "content/browser/devtools/devtools_manager.h"
8 #include "content/browser/devtools/ipc_devtools_agent_host.h" 8 #include "content/browser/devtools/ipc_devtools_agent_host.h"
9 #include "content/browser/devtools/service_worker_devtools_agent_host.h" 9 #include "content/browser/devtools/service_worker_devtools_agent_host.h"
10 #include "content/public/browser/browser_thread.h" 10 #include "content/public/browser/browser_thread.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 return host->IsPausedForDebugOnStart(); 84 return host->IsPausedForDebugOnStart();
85 } 85 }
86 86
87 // Worker was restarted. 87 // Worker was restarted.
88 ServiceWorkerDevToolsAgentHost* agent_host = it->second; 88 ServiceWorkerDevToolsAgentHost* agent_host = it->second;
89 agent_host->WorkerRestarted(id); 89 agent_host->WorkerRestarted(id);
90 workers_.erase(it); 90 workers_.erase(it);
91 workers_[id] = agent_host; 91 workers_[id] = agent_host;
92 DevToolsManager::GetInstance()->AgentHostChanged(agent_host); 92 DevToolsManager::GetInstance()->AgentHostChanged(agent_host);
93 93
94 return it->second->IsAttached(); 94 return agent_host->IsAttached();
95 } 95 }
96 96
97 void ServiceWorkerDevToolsManager::WorkerReadyForInspection( 97 void ServiceWorkerDevToolsManager::WorkerReadyForInspection(
98 int worker_process_id, 98 int worker_process_id,
99 int worker_route_id) { 99 int worker_route_id) {
100 DCHECK_CURRENTLY_ON(BrowserThread::UI); 100 DCHECK_CURRENTLY_ON(BrowserThread::UI);
101 const WorkerId id(worker_process_id, worker_route_id); 101 const WorkerId id(worker_process_id, worker_route_id);
102 AgentHostMap::iterator it = workers_.find(id); 102 AgentHostMap::iterator it = workers_.find(id);
103 DCHECK(it != workers_.end()); 103 DCHECK(it != workers_.end());
104 scoped_refptr<ServiceWorkerDevToolsAgentHost> host = it->second; 104 scoped_refptr<ServiceWorkerDevToolsAgentHost> host = it->second;
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 break; 169 break;
170 } 170 }
171 return it; 171 return it;
172 } 172 }
173 173
174 void ServiceWorkerDevToolsManager::ResetForTesting() { 174 void ServiceWorkerDevToolsManager::ResetForTesting() {
175 workers_.clear(); 175 workers_.clear();
176 } 176 }
177 177
178 } // namespace content 178 } // namespace content
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