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 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
268 | 268 |
269 void ServiceWorkerRegistration::OnDeleteFinished( | 269 void ServiceWorkerRegistration::OnDeleteFinished( |
270 ServiceWorkerStatusCode status) { | 270 ServiceWorkerStatusCode status) { |
271 // Intentionally empty completion callback, used to prevent | 271 // Intentionally empty completion callback, used to prevent |
272 // |this| from being deleted until the storage method completes. | 272 // |this| from being deleted until the storage method completes. |
273 } | 273 } |
274 | 274 |
275 void ServiceWorkerRegistration::Clear() { | 275 void ServiceWorkerRegistration::Clear() { |
276 context_->storage()->NotifyDoneUninstallingRegistration(this); | 276 context_->storage()->NotifyDoneUninstallingRegistration(this); |
277 | 277 |
278 if (installing_version()) { | 278 ChangedVersionAttributesMask mask; |
279 installing_version()->Doom(); | 279 if (installing_version_) { |
280 UnsetVersion(installing_version()); | 280 installing_version_->Doom(); |
281 installing_version_ = NULL; | |
282 mask.add(ChangedVersionAttributesMask::INSTALLING_VERSION); | |
281 } | 283 } |
282 | 284 if (waiting_version_) { |
283 if (waiting_version()) { | 285 waiting_version_->Doom(); |
284 waiting_version()->Doom(); | 286 waiting_version_ = NULL; |
285 UnsetVersion(waiting_version()); | 287 mask.add(ChangedVersionAttributesMask::WAITING_VERSION); |
286 } | 288 } |
287 | 289 if (active_version_) { |
288 if (active_version()) { | 290 active_version_->Doom(); |
falken
2014/08/19 01:00:21
I think you might have to call
active_version_->
nhiroki
2014/08/19 01:04:31
I think we need to call "active_version_->RemoveLi
michaeln
2014/08/19 02:36:11
thnx
I think a call to active_version_->RemoveLis
| |
289 active_version()->Doom(); | 291 active_version_ = NULL; |
290 UnsetVersion(active_version()); | 292 mask.add(ChangedVersionAttributesMask::ACTIVE_VERSION); |
293 } | |
294 if (mask.changed()) { | |
295 ServiceWorkerRegistrationInfo info = GetInfo(); | |
296 FOR_EACH_OBSERVER(Listener, listeners_, | |
297 OnVersionAttributesChanged(this, mask, info)); | |
291 } | 298 } |
292 } | 299 } |
293 | 300 |
294 void ServiceWorkerRegistration::OnStoreFinished( | 301 void ServiceWorkerRegistration::OnStoreFinished( |
295 scoped_refptr<ServiceWorkerVersion> version, | 302 scoped_refptr<ServiceWorkerVersion> version, |
296 ServiceWorkerStatusCode status) { | 303 ServiceWorkerStatusCode status) { |
297 if (!context_) | 304 if (!context_) |
298 return; | 305 return; |
299 context_->storage()->NotifyDoneInstallingRegistration( | 306 context_->storage()->NotifyDoneInstallingRegistration( |
300 this, version.get(), status); | 307 this, version.get(), status); |
301 } | 308 } |
302 | 309 |
303 } // namespace content | 310 } // namespace content |
OLD | NEW |