| 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..ac952b4c68273983708c28688658321eddc4da9f 100644
|
| --- a/content/browser/devtools/embedded_worker_devtools_manager.cc
|
| +++ b/content/browser/devtools/embedded_worker_devtools_manager.cc
|
| @@ -80,6 +80,9 @@ class EmbeddedWorkerDevToolsManager::EmbeddedWorkerDevToolsAgentHost
|
| host->AddRoute(worker_id_.second, this);
|
| }
|
|
|
| + // DevToolsAgentHost override.
|
| + virtual bool IsWorker() OVERRIDE { return true; }
|
| +
|
| // IPCDevToolsAgentHost implementation.
|
| virtual void SendMessageToAgent(IPC::Message* message) OVERRIDE {
|
| if (worker_attached_)
|
| @@ -218,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.
|
| + 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 +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());
|
| scoped_ptr<WorkerInfo> info = workers_.take_and_erase(it);
|
| info->set_state(WORKER_PAUSED);
|
| workers_.set(id, info.Pass());
|
|
|