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 fb583554278d536244e154bc8b51eedbff7c9b0b..41443a87ce572c56207bfa33df93816f61c0817d 100644 |
| --- a/content/browser/devtools/embedded_worker_devtools_manager.cc |
| +++ b/content/browser/devtools/embedded_worker_devtools_manager.cc |
| @@ -218,6 +218,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 05:45:19
Um... looks like this is another undesirable effec
horo
2014/05/13 09:11:21
I think so too.
This is a work around code.
In cur
|
| + 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; |
| } |
| @@ -326,7 +338,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()); |
| scoped_ptr<WorkerInfo> info = workers_.take_and_erase(it); |
| info->set_state(WORKER_PAUSED); |
| workers_.set(id, info.Pass()); |