Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1049)

Unified Diff: content/browser/shared_worker/shared_worker_host.cc

Issue 2249173003: Removes the references to shared workers from the all documents in being deleted frames (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: incorporated nhiroki's comment Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..afef9048c90ccbe5d0a993c9a8aca4f9e00daf7d 100644
--- a/content/browser/shared_worker/shared_worker_host.cc
+++ b/content/browser/shared_worker/shared_worker_host.cc
@@ -132,6 +132,19 @@ void SharedWorkerHost::DocumentDetached(SharedWorkerMessageFilter* filter,
}
}
+void SharedWorkerHost::RenderFrameDetached(int render_process_id,
+ int render_frame_id) {
+ if (!instance_)
+ return;
+ // Walk all instances and remove all the documents in the frame from their
+ // document set.
+ worker_document_set_->RemoveRenderFrame(render_process_id, render_frame_id);
+ if (worker_document_set_->IsEmpty()) {
+ // This worker has no more associated documents - shut it down.
+ TerminateWorker();
+ }
+}
+
void SharedWorkerHost::WorkerContextClosed() {
if (!instance_)
return;
« no previous file with comments | « content/browser/shared_worker/shared_worker_host.h ('k') | content/browser/shared_worker/shared_worker_service_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698