Chromium Code Reviews| 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 6eba2e8ab82a714235f7a0b97f6822f8e3f089cd..25e25fe9ef51feba8888ed4a93f193cb02b461d7 100644 |
| --- a/content/browser/service_worker/service_worker_register_job.cc |
| +++ b/content/browser/service_worker/service_worker_register_job.cc |
| @@ -38,7 +38,8 @@ ServiceWorkerRegisterJob::ServiceWorkerRegisterJob( |
| weak_factory_(this) {} |
| ServiceWorkerRegisterJob::~ServiceWorkerRegisterJob() { |
| - DCHECK(!context_ || phase_ == INITIAL || phase_ == COMPLETE) |
| + DCHECK(!context_ || |
| + phase_ == INITIAL || phase_ == COMPLETE || phase_ == ABORT) |
| << "Jobs should only be interrupted during shutdown."; |
| } |
| @@ -64,6 +65,12 @@ void ServiceWorkerRegisterJob::Start() { |
| weak_factory_.GetWeakPtr())); |
| } |
| +void ServiceWorkerRegisterJob::Abort() { |
|
michaeln
2014/06/19 01:12:32
The Complete() method does cleanup related to not
falken
2014/06/19 03:45:56
Yes, looks reasonable to go through Complete with
nhiroki
2014/06/19 05:05:55
Hmmm... I noticed this might cause a messy thing..
nhiroki
2014/06/19 05:53:09
Updated. In the latest patchset, Abort() calls onl
|
| + SetPhase(ABORT); |
| + if (!is_promise_resolved_) |
| + ResolvePromise(SERVICE_WORKER_ERROR_ABORT, NULL, NULL); |
| +} |
| + |
| bool ServiceWorkerRegisterJob::Equals(ServiceWorkerRegisterJobBase* job) { |
| if (job->GetType() != GetType()) |
| return false; |
| @@ -131,6 +138,8 @@ void ServiceWorkerRegisterJob::SetPhase(Phase phase) { |
| case COMPLETE: |
| DCHECK(phase_ != INITIAL && phase_ != COMPLETE) << phase_; |
| break; |
| + case ABORT: |
| + break; |
| } |
| phase_ = phase; |
| } |