Chromium Code Reviews| 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..cedb5d9c5d14a2caac94e0713bed7ae7b58685a8 100644 |
| --- a/content/browser/service_worker/service_worker_process_manager.cc |
| +++ b/content/browser/service_worker/service_worker_process_manager.cc |
| @@ -216,14 +216,18 @@ void ServiceWorkerProcessManager::AllocateWorkerProcess( |
| } |
| } |
| - // No existing processes available; start a new one. |
| + // ServiceWorkerProcessManager does not know of any renderer processes that |
| + // are available for |pattern|. Create a SiteInstance and ask for a renderer |
| + // process. Attempt to reuse an existing process if possible. |
| // 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); |
|
falken
2017/06/07 00:12:22
does it make sense to DCHECK_NE(REUSE_PENDING_OR_C
|
| - 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 |