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

Unified Diff: content/browser/renderer_host/render_process_host_impl.cc

Issue 2528233003: Defend against RPHI::ForceReleaseWorkerRefCount called twice.
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_process_host_impl.cc
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index a9db38c4e80d175983907baad30eec1fc6eea026..5f59494f19bd78e81b17ed23e6842458015905ad 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -1399,7 +1399,12 @@ void RenderProcessHostImpl::DecrementSharedWorkerRefCount() {
void RenderProcessHostImpl::ForceReleaseWorkerRefCounts() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
- DCHECK(!is_worker_ref_count_disabled_);
+ // ForceReleaseWorkerRefCounts can possibly be called twice if a new
+ // BrowserContext is created at the same address as an one that was just
+ // destroyed, and the new one is also soon destroyed.
+ // https://crbug.com/661843.
horo 2016/11/28 07:26:51 I think we should introduce RenderProcessHostImpl:
falken 2016/11/28 07:34:21 Hm, I considered this (see CL description) but Cle
horo 2016/11/28 08:54:40 After BrowserContext::NotifyWillBeDestroyed() is c
falken 2016/11/29 04:19:36 Hm yea I'm no longer sure of either solution. //co
+ if (is_worker_ref_count_disabled_)
+ return;
is_worker_ref_count_disabled_ = true;
if (!worker_ref_count())
return;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698