| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/service_worker/service_worker_register_job.h" | 5 #include "content/browser/service_worker/service_worker_register_job.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "content/browser/service_worker/service_worker_context_core.h" | 10 #include "content/browser/service_worker/service_worker_context_core.h" |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 context_->job_coordinator()->FinishJob(pattern_, this); | 370 context_->job_coordinator()->FinishJob(pattern_, this); |
| 371 } | 371 } |
| 372 | 372 |
| 373 void ServiceWorkerRegisterJob::CompleteInternal( | 373 void ServiceWorkerRegisterJob::CompleteInternal( |
| 374 ServiceWorkerStatusCode status) { | 374 ServiceWorkerStatusCode status) { |
| 375 SetPhase(COMPLETE); | 375 SetPhase(COMPLETE); |
| 376 if (status != SERVICE_WORKER_OK) { | 376 if (status != SERVICE_WORKER_OK) { |
| 377 if (registration() && registration()->waiting_version()) { | 377 if (registration() && registration()->waiting_version()) { |
| 378 DisassociateWaitingVersionFromDocuments( | 378 DisassociateWaitingVersionFromDocuments( |
| 379 context_, registration()->waiting_version()->version_id()); | 379 context_, registration()->waiting_version()->version_id()); |
| 380 /* |
| 381 context_->storage()->DeleteVersionResources( |
| 382 registration()->waiting_version()->version_id(), |
| 383 base::Bind(&ServiceWorkerUtils::NoOpStatusCallback)); |
| 384 */ |
| 380 registration()->set_waiting_version(NULL); | 385 registration()->set_waiting_version(NULL); |
| 381 } | 386 } |
| 382 if (registration() && !registration()->active_version()) { | 387 if (registration() && !registration()->active_version()) { |
| 383 context_->storage()->DeleteRegistration( | 388 context_->storage()->DeleteRegistration( |
| 384 registration()->id(), | 389 registration()->id(), |
| 385 registration()->script_url().GetOrigin(), | 390 registration()->script_url().GetOrigin(), |
| 386 base::Bind(&ServiceWorkerUtils::NoOpStatusCallback)); | 391 base::Bind(&ServiceWorkerUtils::NoOpStatusCallback)); |
| 387 } | 392 } |
| 388 if (!is_promise_resolved_) | 393 if (!is_promise_resolved_) |
| 389 ResolvePromise(status, NULL, NULL); | 394 ResolvePromise(status, NULL, NULL); |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 473 if (!host->IsContextAlive()) | 478 if (!host->IsContextAlive()) |
| 474 continue; | 479 continue; |
| 475 if (host->waiting_version() && | 480 if (host->waiting_version() && |
| 476 host->waiting_version()->version_id() == version_id) { | 481 host->waiting_version()->version_id() == version_id) { |
| 477 host->SetWaitingVersion(NULL); | 482 host->SetWaitingVersion(NULL); |
| 478 } | 483 } |
| 479 } | 484 } |
| 480 } | 485 } |
| 481 | 486 |
| 482 } // namespace content | 487 } // namespace content |
| OLD | NEW |