Chromium Code Reviews| Index: content/browser/devtools/embedded_worker_devtools_manager.cc |
| diff --git a/content/browser/devtools/embedded_worker_devtools_manager.cc b/content/browser/devtools/embedded_worker_devtools_manager.cc |
| index 64f76249ee3d6ae4943bbe1ec2389d14b398ad07..f749c141546369234c0d848d14a120f59a6ea3be 100644 |
| --- a/content/browser/devtools/embedded_worker_devtools_manager.cc |
| +++ b/content/browser/devtools/embedded_worker_devtools_manager.cc |
| @@ -221,6 +221,18 @@ bool EmbeddedWorkerDevToolsManager::ServiceWorkerCreated( |
| workers_.set(id, info.Pass()); |
| return false; |
| } |
| + if (WORKER_TERMINATED != it->second->state()) { |
| + // WorkerDestroyed is called when EmbeddedWorkerInstance is deleted. But in |
| + // current code ServiceWorkerStorage::DeleteRegistration doesn't remove the |
| + // instance. So WorkerDestroyed could not be called correctly. |
| + // TODO(horo): Remove this if statement when it becomes unnecessary. |
|
kinuko
2014/05/13 16:25:14
nit: You can refer to the issue for stopping worke
horo
2014/05/14 05:09:59
As we talked offline, I changed EmbeddedWorkerDevT
|
| + DLOG(ERROR) << "WorkerDestroyed has not been called correctly."; |
| + WorkerDestroyed(it->first.first, it->first.second); |
| + return ServiceWorkerCreated(worker_process_id, |
| + worker_route_id, |
| + storage_partition_path, |
| + service_worker_scope); |
| + } |
| MoveToPausedState(id, it); |
| return true; |
| } |
| @@ -329,7 +341,7 @@ EmbeddedWorkerDevToolsManager::FindExistingServiceWorkerInfo( |
| void EmbeddedWorkerDevToolsManager::MoveToPausedState( |
| const WorkerId& id, |
| const WorkerInfoMap::iterator& it) { |
| - DCHECK_EQ(WORKER_TERMINATED, it->second->state()); |
| + DCHECK_EQ(WORKER_TERMINATED, it->second->state()); |
|
kinuko
2014/05/13 16:25:14
nit: extra space got in?
horo
2014/05/14 05:09:59
Done.
|
| scoped_ptr<WorkerInfo> info = workers_.take_and_erase(it); |
| info->set_state(WORKER_PAUSED); |
| workers_.set(id, info.Pass()); |