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

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

Issue 292903002: Save running SW instance info, including its SiteInstance, into the ProcessManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Initial Created 6 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/embedded_worker_instance.cc
diff --git a/content/browser/service_worker/embedded_worker_instance.cc b/content/browser/service_worker/embedded_worker_instance.cc
index 2806f12aa2b4af875b7c9aa1059a14ad100c0d13..20a26c897f8778e7439119d363c7c6b24d1cc344 100644
--- a/content/browser/service_worker/embedded_worker_instance.cc
+++ b/content/browser/service_worker/embedded_worker_instance.cc
@@ -93,7 +93,7 @@ EmbeddedWorkerInstance::~EmbeddedWorkerInstance() {
if (worker_devtools_agent_route_id_ != MSG_ROUTING_NONE)
NotifyWorkerDestroyed(process_id_, worker_devtools_agent_route_id_);
if (context_ && process_id_ != -1)
- context_->process_manager()->ReleaseWorkerProcess(process_id_);
+ context_->process_manager()->ReleaseWorkerProcess(embedded_worker_id_);
registry_->RemoveWorker(process_id_, embedded_worker_id_);
}
@@ -117,6 +117,7 @@ void EmbeddedWorkerInstance::Start(int64 service_worker_version_id,
params->worker_devtools_agent_route_id = MSG_ROUTING_NONE;
params->pause_on_start = false;
context_->process_manager()->AllocateWorkerProcess(
+ embedded_worker_id_,
SortProcesses(possible_process_ids),
script_url,
base::Bind(&EmbeddedWorkerInstance::RunProcessAllocated,
@@ -186,7 +187,8 @@ void EmbeddedWorkerInstance::RunProcessAllocated(
return;
}
if (!instance) {
- context->process_manager()->ReleaseWorkerProcess(process_id);
+ context->process_manager()->ReleaseWorkerProcess(
+ instance->embedded_worker_id_);
callback.Run(SERVICE_WORKER_ERROR_ABORT);
return;
}
@@ -249,7 +251,7 @@ void EmbeddedWorkerInstance::OnStopped() {
if (worker_devtools_agent_route_id_ != MSG_ROUTING_NONE)
NotifyWorkerDestroyed(process_id_, worker_devtools_agent_route_id_);
if (context_)
- context_->process_manager()->ReleaseWorkerProcess(process_id_);
+ context_->process_manager()->ReleaseWorkerProcess(embedded_worker_id_);
status_ = STOPPED;
process_id_ = -1;
thread_id_ = -1;

Powered by Google App Engine
This is Rietveld 408576698