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

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

Issue 2857213005: PlzNavigate: implement process reuse for ServiceWorkers (Closed)
Patch Set: Created 3 years, 7 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/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 9056e76f03596ef69ab275846ef148da8d92c87c..2ee78caa2f38500ba947ca89a2ddc9a098c16874 100644
--- a/content/browser/service_worker/service_worker_process_manager.cc
+++ b/content/browser/service_worker/service_worker_process_manager.cc
@@ -11,6 +11,7 @@
#include "content/browser/renderer_host/render_process_host_impl.h"
#include "content/browser/service_worker/service_worker_context_wrapper.h"
+#include "content/browser/site_instance_impl.h"
#include "content/common/service_worker/embedded_worker_settings.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/content_browser_client.h"
@@ -216,8 +217,11 @@ void ServiceWorkerProcessManager::AllocateWorkerProcess(
}
// No existing processes available; start a new one.
- scoped_refptr<SiteInstance> site_instance =
- SiteInstance::CreateForURL(browser_context_, script_url);
+ scoped_refptr<SiteInstanceImpl> site_instance =
+ SiteInstanceImpl::CreateForURL(browser_context_, script_url);
+ site_instance->set_process_reuse_policy(
+ SiteInstanceImpl::ProcessReusePolicy::
+ REUSE_CHECKING_FRAMES_AND_NAVIGATIONS);
nasko 2017/05/05 05:22:00 Reading this code, I wonder if it will be more nat
clamy 2017/05/05 15:10:11 Except it could have already been set in other cas
Charlie Reis 2017/05/15 03:41:52 Just curious, what's the advantage of either of th
clamy 2017/05/16 14:50:46 I'm leaving it as is for now.
RenderProcessHost* rph = site_instance->GetProcess();
// This Init() call posts a task to the IO thread that adds the RPH's

Powered by Google App Engine
This is Rietveld 408576698