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

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

Issue 517493002: ServiceWorker: Update the install sequence as per the latest spec (Closed) Base URL: http://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment fix (+rebase) Created 6 years, 3 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
OLDNEW
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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 } 59 }
60 60
61 void ServiceWorkerRegistration::RemoveListener(Listener* listener) { 61 void ServiceWorkerRegistration::RemoveListener(Listener* listener) {
62 listeners_.RemoveObserver(listener); 62 listeners_.RemoveObserver(listener);
63 } 63 }
64 64
65 void ServiceWorkerRegistration::NotifyRegistrationFailed() { 65 void ServiceWorkerRegistration::NotifyRegistrationFailed() {
66 FOR_EACH_OBSERVER(Listener, listeners_, OnRegistrationFailed(this)); 66 FOR_EACH_OBSERVER(Listener, listeners_, OnRegistrationFailed(this));
67 } 67 }
68 68
69 void ServiceWorkerRegistration::NotifyUpdateFound() {
70 FOR_EACH_OBSERVER(Listener, listeners_, OnUpdateFound(this));
71 }
72
69 ServiceWorkerRegistrationInfo ServiceWorkerRegistration::GetInfo() { 73 ServiceWorkerRegistrationInfo ServiceWorkerRegistration::GetInfo() {
70 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 74 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
71 return ServiceWorkerRegistrationInfo( 75 return ServiceWorkerRegistrationInfo(
72 pattern(), 76 pattern(),
73 registration_id_, 77 registration_id_,
74 GetVersionInfo(active_version_.get()), 78 GetVersionInfo(active_version_.get()),
75 GetVersionInfo(waiting_version_.get()), 79 GetVersionInfo(waiting_version_.get()),
76 GetVersionInfo(installing_version_.get())); 80 GetVersionInfo(installing_version_.get()));
77 } 81 }
78 82
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 if (!context_) { 324 if (!context_) {
321 callback.Run(ServiceWorkerStatusCode::SERVICE_WORKER_ERROR_ABORT); 325 callback.Run(ServiceWorkerStatusCode::SERVICE_WORKER_ERROR_ABORT);
322 return; 326 return;
323 } 327 }
324 context_->storage()->NotifyDoneInstallingRegistration( 328 context_->storage()->NotifyDoneInstallingRegistration(
325 this, version.get(), status); 329 this, version.get(), status);
326 callback.Run(status); 330 callback.Run(status);
327 } 331 }
328 332
329 } // namespace content 333 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698