Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Side by Side Diff: content/browser/service_worker/service_worker_unregister_job.cc

Issue 229403004: Assert about ServiceWorkerRegisterJob internal state in terms of phases (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix ctor/dtor style error and bad merge Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/browser/service_worker/service_worker_register_job_base.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_unregister_job.h" 5 #include "content/browser/service_worker/service_worker_unregister_job.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_job_coordinator.h" 8 #include "content/browser/service_worker/service_worker_job_coordinator.h"
9 #include "content/browser/service_worker/service_worker_registration.h" 9 #include "content/browser/service_worker/service_worker_registration.h"
10 #include "content/browser/service_worker/service_worker_storage.h" 10 #include "content/browser/service_worker/service_worker_storage.h"
(...skipping 23 matching lines...) Expand all
34 weak_factory_.GetWeakPtr())); 34 weak_factory_.GetWeakPtr()));
35 } 35 }
36 36
37 bool ServiceWorkerUnregisterJob::Equals(ServiceWorkerRegisterJobBase* job) { 37 bool ServiceWorkerUnregisterJob::Equals(ServiceWorkerRegisterJobBase* job) {
38 if (job->GetType() != GetType()) 38 if (job->GetType() != GetType())
39 return false; 39 return false;
40 return static_cast<ServiceWorkerUnregisterJob*>(job)->pattern_ == pattern_; 40 return static_cast<ServiceWorkerUnregisterJob*>(job)->pattern_ == pattern_;
41 } 41 }
42 42
43 RegistrationJobType ServiceWorkerUnregisterJob::GetType() { 43 RegistrationJobType ServiceWorkerUnregisterJob::GetType() {
44 return ServiceWorkerRegisterJobBase::UNREGISTER; 44 return ServiceWorkerRegisterJobBase::UNREGISTRATION;
45 } 45 }
46 46
47 void ServiceWorkerUnregisterJob::DeleteExistingRegistration( 47 void ServiceWorkerUnregisterJob::DeleteExistingRegistration(
48 ServiceWorkerStatusCode status, 48 ServiceWorkerStatusCode status,
49 const scoped_refptr<ServiceWorkerRegistration>& registration) { 49 const scoped_refptr<ServiceWorkerRegistration>& registration) {
50 if (status == SERVICE_WORKER_OK) { 50 if (status == SERVICE_WORKER_OK) {
51 context_->storage()->DeleteRegistration( 51 context_->storage()->DeleteRegistration(
52 pattern_, 52 pattern_,
53 base::Bind(&ServiceWorkerUnregisterJob::Complete, 53 base::Bind(&ServiceWorkerUnregisterJob::Complete,
54 weak_factory_.GetWeakPtr())); 54 weak_factory_.GetWeakPtr()));
(...skipping 12 matching lines...) Expand all
67 void ServiceWorkerUnregisterJob::Complete(ServiceWorkerStatusCode status) { 67 void ServiceWorkerUnregisterJob::Complete(ServiceWorkerStatusCode status) {
68 for (std::vector<UnregistrationCallback>::iterator it = callbacks_.begin(); 68 for (std::vector<UnregistrationCallback>::iterator it = callbacks_.begin();
69 it != callbacks_.end(); 69 it != callbacks_.end();
70 ++it) { 70 ++it) {
71 it->Run(status); 71 it->Run(status);
72 } 72 }
73 context_->job_coordinator()->FinishJob(pattern_, this); 73 context_->job_coordinator()->FinishJob(pattern_, this);
74 } 74 }
75 75
76 } // namespace content 76 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/service_worker/service_worker_register_job_base.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698