| 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 <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "content/browser/service_worker/service_worker_context_core.h" | 9 #include "content/browser/service_worker/service_worker_context_core.h" |
| 10 #include "content/browser/service_worker/service_worker_info.h" | 10 #include "content/browser/service_worker/service_worker_info.h" |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 activating_version->SetStatus(ServiceWorkerVersion::ACTIVATING); | 283 activating_version->SetStatus(ServiceWorkerVersion::ACTIVATING); |
| 284 // "9. Fire a simple event named controllerchange..." | 284 // "9. Fire a simple event named controllerchange..." |
| 285 if (activating_version->skip_waiting()) | 285 if (activating_version->skip_waiting()) |
| 286 FOR_EACH_OBSERVER(Listener, listeners_, OnSkippedWaiting(this)); | 286 FOR_EACH_OBSERVER(Listener, listeners_, OnSkippedWaiting(this)); |
| 287 | 287 |
| 288 // "10. Queue a task to fire an event named activate..." | 288 // "10. Queue a task to fire an event named activate..." |
| 289 activating_version->RunAfterStartWorker( | 289 activating_version->RunAfterStartWorker( |
| 290 base::Bind(&ServiceWorkerRegistration::DispatchActivateEvent, this, | 290 base::Bind(&ServiceWorkerRegistration::DispatchActivateEvent, this, |
| 291 activating_version), | 291 activating_version), |
| 292 base::Bind(&ServiceWorkerRegistration::OnActivateEventFinished, this, | 292 base::Bind(&ServiceWorkerRegistration::OnActivateEventFinished, this, |
| 293 activating_version)); | 293 activating_version), |
| 294 ServiceWorkerMetrics::EventType::ACTIVATE); |
| 294 } | 295 } |
| 295 | 296 |
| 296 void ServiceWorkerRegistration::DeleteVersion( | 297 void ServiceWorkerRegistration::DeleteVersion( |
| 297 const scoped_refptr<ServiceWorkerVersion>& version) { | 298 const scoped_refptr<ServiceWorkerVersion>& version) { |
| 298 DCHECK_EQ(id(), version->registration_id()); | 299 DCHECK_EQ(id(), version->registration_id()); |
| 299 | 300 |
| 300 UnsetVersion(version.get()); | 301 UnsetVersion(version.get()); |
| 301 | 302 |
| 302 for (scoped_ptr<ServiceWorkerContextCore::ProviderHostIterator> it = | 303 for (scoped_ptr<ServiceWorkerContextCore::ProviderHostIterator> it = |
| 303 context_->GetProviderHostIterator(); | 304 context_->GetProviderHostIterator(); |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 430 if (!context_) { | 431 if (!context_) { |
| 431 callback.Run(SERVICE_WORKER_ERROR_ABORT); | 432 callback.Run(SERVICE_WORKER_ERROR_ABORT); |
| 432 return; | 433 return; |
| 433 } | 434 } |
| 434 context_->storage()->NotifyDoneInstallingRegistration( | 435 context_->storage()->NotifyDoneInstallingRegistration( |
| 435 this, version.get(), status); | 436 this, version.get(), status); |
| 436 callback.Run(status); | 437 callback.Run(status); |
| 437 } | 438 } |
| 438 | 439 |
| 439 } // namespace content | 440 } // namespace content |
| OLD | NEW |