| Index: content/browser/shared_worker/shared_worker_host.cc
|
| diff --git a/content/browser/shared_worker/shared_worker_host.cc b/content/browser/shared_worker/shared_worker_host.cc
|
| index bf7767efbabcd8bf0a66238ee1cf85beb1f48c5e..1e7bf376625b937bbe2db2ac837957f976d84168 100644
|
| --- a/content/browser/shared_worker/shared_worker_host.cc
|
| +++ b/content/browser/shared_worker/shared_worker_host.cc
|
| @@ -132,6 +132,17 @@ void SharedWorkerHost::DocumentDetached(SharedWorkerMessageFilter* filter,
|
| }
|
| }
|
|
|
| +void SharedWorkerHost::DetachAllDocument(SharedWorkerMessageFilter* filter) {
|
| + if (!instance_)
|
| + return;
|
| + // Walk all instances and remove the all documents from their document set.
|
| + worker_document_set_->RemoveAll(filter);
|
| + if (worker_document_set_->IsEmpty()) {
|
| + // This worker has no more associated documents - shut it down.
|
| + TerminateWorker();
|
| + }
|
| +}
|
| +
|
| void SharedWorkerHost::WorkerContextClosed() {
|
| if (!instance_)
|
| return;
|
|
|