Index: content/browser/service_worker/embedded_worker_registry.cc |
diff --git a/content/browser/service_worker/embedded_worker_registry.cc b/content/browser/service_worker/embedded_worker_registry.cc |
index 7ed1ba093f98991c966f89a0d242fc3dffd280d7..7044b0c3514600936e406f0e079c9d8439c678c6 100644 |
--- a/content/browser/service_worker/embedded_worker_registry.cc |
+++ b/content/browser/service_worker/embedded_worker_registry.cc |
@@ -6,12 +6,13 @@ |
#include "base/bind_helpers.h" |
#include "base/stl_util.h" |
-#include "content/browser/renderer_host/render_widget_helper.h" |
#include "content/browser/service_worker/embedded_worker_instance.h" |
#include "content/browser/service_worker/service_worker_context_core.h" |
#include "content/browser/service_worker/service_worker_context_wrapper.h" |
#include "content/common/service_worker/embedded_worker_messages.h" |
+#include "content/common/service_worker/service_worker_messages.h" |
#include "content/public/browser/browser_thread.h" |
+#include "content/public/browser/render_process_host.h" |
#include "ipc/ipc_message.h" |
#include "ipc/ipc_sender.h" |
@@ -46,12 +47,14 @@ void EmbeddedWorkerRegistry::StartWorker(const std::vector<int>& process_ids, |
params->scope = scope; |
params->script_url = script_url; |
params->worker_devtools_agent_route_id = MSG_ROUTING_NONE; |
+ params->pause_on_start = false; |
context_->process_manager()->AllocateWorkerProcess( |
process_ids, |
+ context_->storage_partition_path(), |
kinuko
2014/05/02 11:12:45
Btw this could be given to ctor of ServiceWorkerPr
horo
2014/05/07 08:34:44
Done.
|
+ scope, |
script_url, |
base::Bind(&EmbeddedWorkerRegistry::StartWorkerWithProcessId, |
this, |
- embedded_worker_id, |
base::Passed(¶ms), |
callback)); |
} |
@@ -199,13 +202,14 @@ EmbeddedWorkerRegistry::~EmbeddedWorkerRegistry() { |
} |
void EmbeddedWorkerRegistry::StartWorkerWithProcessId( |
- int embedded_worker_id, |
scoped_ptr<EmbeddedWorkerMsg_StartWorker_Params> params, |
const StatusCallback& callback, |
ServiceWorkerStatusCode status, |
- int process_id) { |
+ int process_id, |
+ int worker_devtools_agent_route_id, |
+ bool pause_on_start) { |
WorkerInstanceMap::const_iterator worker = |
- worker_map_.find(embedded_worker_id); |
+ worker_map_.find(params->embedded_worker_id); |
if (worker == worker_map_.end()) { |
// The Instance was destroyed before it could finish starting. Undo what |
// we've done so far. |
@@ -214,16 +218,8 @@ void EmbeddedWorkerRegistry::StartWorkerWithProcessId( |
callback.Run(SERVICE_WORKER_ERROR_ABORT); |
return; |
} |
- if (status == SERVICE_WORKER_OK) { |
- // Gets the new routing id for the renderer process. |
- scoped_refptr<RenderWidgetHelper> helper( |
- RenderWidgetHelper::FromProcessHostID(process_id)); |
- // |helper| may be NULL in unittest. |
- params->worker_devtools_agent_route_id = |
- helper ? helper->GetNextRoutingID() : MSG_ROUTING_NONE; |
- } |
worker->second->RecordProcessId( |
- process_id, status, params->worker_devtools_agent_route_id); |
+ process_id, status, worker_devtools_agent_route_id); |
if (status != SERVICE_WORKER_OK) { |
callback.Run(status); |
@@ -233,6 +229,8 @@ void EmbeddedWorkerRegistry::StartWorkerWithProcessId( |
// is created, and keep an entry in process_sender_map_ for its whole |
// lifetime. |
DCHECK(ContainsKey(process_sender_map_, process_id)); |
+ params->worker_devtools_agent_route_id = worker_devtools_agent_route_id; |
+ params->pause_on_start = pause_on_start; |
callback.Run(Send(process_id, new EmbeddedWorkerMsg_StartWorker(*params))); |
} |