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

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

Issue 380093002: Update installed ServiceWorkers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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
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 27 matching lines...) Expand all
38 CompleteInternal(SERVICE_WORKER_ERROR_ABORT); 38 CompleteInternal(SERVICE_WORKER_ERROR_ABORT);
39 } 39 }
40 40
41 bool ServiceWorkerUnregisterJob::Equals(ServiceWorkerRegisterJobBase* job) { 41 bool ServiceWorkerUnregisterJob::Equals(ServiceWorkerRegisterJobBase* job) {
42 if (job->GetType() != GetType()) 42 if (job->GetType() != GetType())
43 return false; 43 return false;
44 return static_cast<ServiceWorkerUnregisterJob*>(job)->pattern_ == pattern_; 44 return static_cast<ServiceWorkerUnregisterJob*>(job)->pattern_ == pattern_;
45 } 45 }
46 46
47 RegistrationJobType ServiceWorkerUnregisterJob::GetType() { 47 RegistrationJobType ServiceWorkerUnregisterJob::GetType() {
48 return ServiceWorkerRegisterJobBase::UNREGISTRATION; 48 return UNREGISTRATION_JOB;
49 } 49 }
50 50
51 void ServiceWorkerUnregisterJob::OnRegistrationFound( 51 void ServiceWorkerUnregisterJob::OnRegistrationFound(
52 ServiceWorkerStatusCode status, 52 ServiceWorkerStatusCode status,
53 const scoped_refptr<ServiceWorkerRegistration>& registration) { 53 const scoped_refptr<ServiceWorkerRegistration>& registration) {
54 if (status == SERVICE_WORKER_ERROR_NOT_FOUND) { 54 if (status == SERVICE_WORKER_ERROR_NOT_FOUND) {
55 DCHECK(!registration); 55 DCHECK(!registration);
56 Complete(SERVICE_WORKER_OK); 56 Complete(SERVICE_WORKER_OK);
57 return; 57 return;
58 } 58 }
(...skipping 30 matching lines...) Expand all
89 void ServiceWorkerUnregisterJob::CompleteInternal( 89 void ServiceWorkerUnregisterJob::CompleteInternal(
90 ServiceWorkerStatusCode status) { 90 ServiceWorkerStatusCode status) {
91 for (std::vector<UnregistrationCallback>::iterator it = callbacks_.begin(); 91 for (std::vector<UnregistrationCallback>::iterator it = callbacks_.begin();
92 it != callbacks_.end(); 92 it != callbacks_.end();
93 ++it) { 93 ++it) {
94 it->Run(status); 94 it->Run(status);
95 } 95 }
96 } 96 }
97 97
98 } // namespace content 98 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698