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_registration.h" | 5 #include "content/browser/service_worker/service_worker_registration.h" |
6 | 6 |
7 #include "content/browser/service_worker/service_worker_context_core.h" | 7 #include "content/browser/service_worker/service_worker_context_core.h" |
8 #include "content/browser/service_worker/service_worker_info.h" | 8 #include "content/browser/service_worker/service_worker_info.h" |
9 #include "content/browser/service_worker/service_worker_register_job.h" | 9 #include "content/browser/service_worker/service_worker_register_job.h" |
10 #include "content/browser/service_worker/service_worker_utils.h" | 10 #include "content/browser/service_worker/service_worker_utils.h" |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 UnsetVersion(activating_version); | 297 UnsetVersion(activating_version); |
298 activating_version->Doom(); | 298 activating_version->Doom(); |
299 if (!waiting_version()) { | 299 if (!waiting_version()) { |
300 // Delete the records from the db. | 300 // Delete the records from the db. |
301 context_->storage()->DeleteRegistration( | 301 context_->storage()->DeleteRegistration( |
302 id(), pattern().GetOrigin(), | 302 id(), pattern().GetOrigin(), |
303 base::Bind(&ServiceWorkerRegistration::OnDeleteFinished, this)); | 303 base::Bind(&ServiceWorkerRegistration::OnDeleteFinished, this)); |
304 // But not from memory if there is a version in the pipeline. | 304 // But not from memory if there is a version in the pipeline. |
305 if (installing_version()) | 305 if (installing_version()) |
306 is_deleted_ = false; | 306 is_deleted_ = false; |
| 307 else |
| 308 FOR_EACH_OBSERVER(Listener, listeners_, OnRegistrationFailed(this)); |
307 } | 309 } |
308 return; | 310 return; |
309 } | 311 } |
310 | 312 |
311 // "12. Run the [[UpdateState]] algorithm passing registration.activeWorker | 313 // "12. Run the [[UpdateState]] algorithm passing registration.activeWorker |
312 // and "activated" as the arguments." | 314 // and "activated" as the arguments." |
313 activating_version->SetStatus(ServiceWorkerVersion::ACTIVATED); | 315 activating_version->SetStatus(ServiceWorkerVersion::ACTIVATED); |
314 if (context_) { | 316 if (context_) { |
315 context_->storage()->UpdateToActiveState( | 317 context_->storage()->UpdateToActiveState( |
316 this, | 318 this, |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 if (registration && | 410 if (registration && |
409 (registration->is_uninstalling() || registration->is_uninstalled())) | 411 (registration->is_uninstalling() || registration->is_uninstalled())) |
410 continue; | 412 continue; |
411 if (matcher.MatchLongest(info.pattern)) | 413 if (matcher.MatchLongest(info.pattern)) |
412 return false; | 414 return false; |
413 } | 415 } |
414 return true; | 416 return true; |
415 } | 417 } |
416 | 418 |
417 } // namespace content | 419 } // namespace content |
OLD | NEW |