| Index: content/browser/service_worker/service_worker_register_job.cc
|
| diff --git a/content/browser/service_worker/service_worker_register_job.cc b/content/browser/service_worker/service_worker_register_job.cc
|
| index 27b687ecad6cfaf4b8cd2c560a7996bd4ebf0b41..eb80fbf63d570e513deef982cc3eadd0803f246c 100644
|
| --- a/content/browser/service_worker/service_worker_register_job.cc
|
| +++ b/content/browser/service_worker/service_worker_register_job.cc
|
| @@ -43,14 +43,10 @@ ServiceWorkerRegisterJob::~ServiceWorkerRegisterJob() {
|
|
|
| void ServiceWorkerRegisterJob::AddCallback(const RegistrationCallback& callback,
|
| int process_id) {
|
| - DCHECK_NE(-1, process_id);
|
| - if (phase_ >= UPDATE && pending_version())
|
| - pending_version()->AddProcessToWorker(process_id);
|
| - else
|
| - pending_process_ids_.push_back(process_id);
|
| -
|
| if (!is_promise_resolved_) {
|
| callbacks_.push_back(callback);
|
| + if (process_id != -1 && (phase_ < UPDATE || !pending_version()))
|
| + pending_process_ids_.push_back(process_id);
|
| return;
|
| }
|
| RunSoon(base::Bind(
|
| @@ -228,17 +224,13 @@ void ServiceWorkerRegisterJob::UpdateAndContinue(
|
| // the worker.
|
| set_pending_version(new ServiceWorkerVersion(
|
| registration(), context_->storage()->NewVersionId(), context_));
|
| - for (std::vector<int>::const_iterator it = pending_process_ids_.begin();
|
| - it != pending_process_ids_.end();
|
| - ++it) {
|
| - pending_version()->AddProcessToWorker(*it);
|
| - }
|
|
|
| // TODO(michaeln): Start the worker into a paused state where the
|
| // script resource is downloaded but not yet evaluated.
|
| pending_version()->StartWorker(
|
| base::Bind(&ServiceWorkerRegisterJob::OnStartWorkerFinished,
|
| - weak_factory_.GetWeakPtr()));
|
| + weak_factory_.GetWeakPtr()),
|
| + pending_process_ids_);
|
| }
|
|
|
| void ServiceWorkerRegisterJob::OnStartWorkerFinished(
|
|
|