diff options
author | yurys@chromium.org <yurys@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-21 06:49:54 +0000 |
---|---|---|
committer | yurys@chromium.org <yurys@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-21 06:49:54 +0000 |
commit | f44d1193f728c17cc4fd7adfe11a3fce82cddb9b (patch) | |
tree | 20bb8549bcafc3dd769b83c51aecc01b37c55952 /content/browser/worker_host | |
parent | 235b2197b020160e95dcf6456dce9ba45a396fbe (diff) | |
download | chromium_src-f44d1193f728c17cc4fd7adfe11a3fce82cddb9b.zip chromium_src-f44d1193f728c17cc4fd7adfe11a3fce82cddb9b.tar.gz chromium_src-f44d1193f728c17cc4fd7adfe11a3fce82cddb9b.tar.bz2 |
When WorkerProcessHost receives WorkerHostMsg_WorkerContextDestroyed message it will always notify worker service observers even if there is no corresponding WorkerInstance in WorkerProcessHost::instances_ list(the instance can be removed when WorkerMessageFilter is closed).
WorkerDevToolsManager::InspectedWorkersList has been merged into WorkerDevToolsManager.
BUG=None
TEST=None
Review URL: http://codereview.chromium.org/8364008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106686 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/worker_host')
4 files changed, 11 insertions, 6 deletions
diff --git a/content/browser/worker_host/worker_process_host.cc b/content/browser/worker_host/worker_process_host.cc index 140d272..b3893d1 100644 --- a/content/browser/worker_host/worker_process_host.cc +++ b/content/browser/worker_host/worker_process_host.cc @@ -112,7 +112,8 @@ WorkerProcessHost::~WorkerProcessHost() { new WorkerCrashTask(parent_iter->render_process_id(), parent_iter->render_view_id())); } - WorkerService::GetInstance()->NotifyWorkerDestroyed(this, *i); + WorkerService::GetInstance()->NotifyWorkerDestroyed(this, + i->worker_route_id()); } ChildProcessSecurityPolicy::GetInstance()->Remove(id()); @@ -335,6 +336,11 @@ bool WorkerProcessHost::OnMessageReceived(const IPC::Message& message) { if (handled) return true; + if (message.type() == WorkerHostMsg_WorkerContextDestroyed::ID) { + WorkerService::GetInstance()->NotifyWorkerDestroyed(this, + message.routing_id()); + } + for (Instances::iterator i = instances_.begin(); i != instances_.end(); ++i) { if (i->worker_route_id() == message.routing_id()) { if (!i->shared()) { @@ -345,7 +351,6 @@ bool WorkerProcessHost::OnMessageReceived(const IPC::Message& message) { } if (message.type() == WorkerHostMsg_WorkerContextDestroyed::ID) { - WorkerService::GetInstance()->NotifyWorkerDestroyed(this, *i); instances_.erase(i); UpdateTitle(); } diff --git a/content/browser/worker_host/worker_service.cc b/content/browser/worker_host/worker_service.cc index 93706d2..d33ebcc 100644 --- a/content/browser/worker_host/worker_service.cc +++ b/content/browser/worker_host/worker_service.cc @@ -506,9 +506,9 @@ void WorkerService::RemoveObserver(WorkerServiceObserver* observer) { void WorkerService::NotifyWorkerDestroyed( WorkerProcessHost* process, - const WorkerProcessHost::WorkerInstance& instance) { + int worker_route_id) { FOR_EACH_OBSERVER(WorkerServiceObserver, observers_, - WorkerDestroyed(process, instance)); + WorkerDestroyed(process, worker_route_id)); } void WorkerService::NotifyWorkerContextStarted(WorkerProcessHost* process, diff --git a/content/browser/worker_host/worker_service.h b/content/browser/worker_host/worker_service.h index 635dd8b..69af159 100644 --- a/content/browser/worker_host/worker_service.h +++ b/content/browser/worker_host/worker_service.h @@ -67,7 +67,7 @@ class WorkerService { void NotifyWorkerDestroyed( WorkerProcessHost* process, - const WorkerProcessHost::WorkerInstance& instance); + int worker_route_id); void NotifyWorkerContextStarted( WorkerProcessHost* process, int worker_route_id); diff --git a/content/browser/worker_host/worker_service_observer.h b/content/browser/worker_host/worker_service_observer.h index 8ee4514..ae52edd 100644 --- a/content/browser/worker_host/worker_service_observer.h +++ b/content/browser/worker_host/worker_service_observer.h @@ -15,7 +15,7 @@ class WorkerServiceObserver { const WorkerProcessHost::WorkerInstance& instance) = 0; virtual void WorkerDestroyed( WorkerProcessHost* process, - const WorkerProcessHost::WorkerInstance& instance) = 0; + int worker_route_id) = 0; virtual void WorkerContextStarted( WorkerProcessHost* process, int worker_route_id) = 0; |