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

Unified Diff: content/browser/service_worker/service_worker_dispatcher_host.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: Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/service_worker/service_worker_dispatcher_host.cc
diff --git a/content/browser/service_worker/service_worker_dispatcher_host.cc b/content/browser/service_worker/service_worker_dispatcher_host.cc
index d20bbbeccb9632608427b84494cb44d8d74251b6..4ffb489b6d5929d4281ba7249b2d33114e3b5aec 100644
--- a/content/browser/service_worker/service_worker_dispatcher_host.cc
+++ b/content/browser/service_worker/service_worker_dispatcher_host.cc
@@ -376,11 +376,32 @@ void ServiceWorkerDispatcherHost::RegistrationComplete(
new ServiceWorkerRegistrationHandle(
GetContext()->AsWeakPtr(), this, provider_id, registration));
info = new_handle->GetObjectInfo();
+ handle = new_handle.get();
RegisterServiceWorkerRegistrationHandle(new_handle.Pass());
}
+ ChangedVersionAttributesMask mask;
michaeln 2014/08/29 00:57:57 the 'change mask' seems out of place here? what's
nhiroki 2014/08/29 08:23:10 That makes sense. Removed the mask and made the di
+ ServiceWorkerVersionAttributes attrs;
+
+ if (registration->installing_version()) {
+ mask.add(ChangedVersionAttributesMask::INSTALLING_VERSION);
+ attrs.installing = handle->CreateServiceWorkerHandleAndPass(
+ registration->installing_version());
+ }
+ if (registration->waiting_version()) {
+ mask.add(ChangedVersionAttributesMask::WAITING_VERSION);
+ attrs.waiting = handle->CreateServiceWorkerHandleAndPass(
+ registration->waiting_version());
+ }
+ if (registration->active_version()) {
+ mask.add(ChangedVersionAttributesMask::ACTIVE_VERSION);
+ attrs.active = handle->CreateServiceWorkerHandleAndPass(
+ registration->active_version());
+ }
+ attrs.changed_mask = mask.changed();
+
Send(new ServiceWorkerMsg_ServiceWorkerRegistered(
- thread_id, request_id, info));
+ thread_id, request_id, info, attrs));
}
void ServiceWorkerDispatcherHost::OnWorkerReadyForInspection(

Powered by Google App Engine
This is Rietveld 408576698