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

Unified Diff: content/browser/service_worker/service_worker_process_manager.cc

Issue 2925623004: Only use SiteInstance process reuse for ServiceWorker with no failures (Closed)
Patch Set: Created 3 years, 6 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
« 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/service_worker/service_worker_process_manager.cc
diff --git a/content/browser/service_worker/service_worker_process_manager.cc b/content/browser/service_worker/service_worker_process_manager.cc
index b7fbe590ba6c1bc747066ef2c9f6c6d26fe3bfdd..12a336ac1cc57d375546b501ef11813e77e9e6dd 100644
--- a/content/browser/service_worker/service_worker_process_manager.cc
+++ b/content/browser/service_worker/service_worker_process_manager.cc
@@ -216,14 +216,17 @@ void ServiceWorkerProcessManager::AllocateWorkerProcess(
}
}
- // No existing processes available; start a new one.
+ // No existing processes available; start a new one. Attempt to reuse an
+ // existing process if possible.
falken 2017/06/06 13:32:43 Now these sentences read like a contradiction :) H
clamy 2017/06/06 16:37:39 Done.
// TODO(clamy): Update the process reuse mechanism above following the
// implementation of
// SiteInstanceImpl::ProcessReusePolicy::REUSE_PENDING_OR_COMMITTED_SITE.
scoped_refptr<SiteInstanceImpl> site_instance =
SiteInstanceImpl::CreateForURL(browser_context_, script_url);
- site_instance->set_process_reuse_policy(
- SiteInstanceImpl::ProcessReusePolicy::REUSE_PENDING_OR_COMMITTED_SITE);
+ if (can_use_existing_process) {
+ site_instance->set_process_reuse_policy(
+ SiteInstanceImpl::ProcessReusePolicy::REUSE_PENDING_OR_COMMITTED_SITE);
+ }
RenderProcessHost* rph = site_instance->GetProcess();
// This Init() call posts a task to the IO thread that adds the RPH's
« 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