Index: content/browser/service_worker/service_worker_storage.cc |
diff --git a/content/browser/service_worker/service_worker_storage.cc b/content/browser/service_worker/service_worker_storage.cc |
index 62d198bd5aa6e6678b0a66b786222d9d77415c29..992d780a139fa93ed1eccb188cf53c9764a6ca17 100644 |
--- a/content/browser/service_worker/service_worker_storage.cc |
+++ b/content/browser/service_worker/service_worker_storage.cc |
@@ -579,12 +579,21 @@ void ServiceWorkerStorage::DidGetAllRegistrations( |
info.pattern = it->scope; |
info.script_url = it->script; |
info.registration_id = it->registration_id; |
- info.active_version.is_null = false; |
- if (it->is_active) |
- info.active_version.status = ServiceWorkerVersion::ACTIVE; |
- else |
- info.active_version.status = ServiceWorkerVersion::INSTALLED; |
- info.active_version.version_id = it->version_id; |
+ if (ServiceWorkerVersion* version = |
+ context_->GetLiveVersion(it->version_id)) { |
+ if (it->is_active) { |
+ info.active_version = version->GetInfo(); |
+ } else { |
+ info.pending_version = version->GetInfo(); |
+ } |
nhiroki
2014/06/03 04:56:52
nit: can you omit {} like line 590-594?
horo
2014/06/03 05:10:47
Done.
|
+ } else { |
+ info.active_version.is_null = false; |
+ if (it->is_active) |
+ info.active_version.status = ServiceWorkerVersion::ACTIVE; |
+ else |
+ info.active_version.status = ServiceWorkerVersion::INSTALLED; |
+ info.active_version.version_id = it->version_id; |
nhiroki
2014/06/03 04:56:52
Hmm... this is not related to this CL, but these s
nhiroki
2014/06/03 05:00:15
I think it's ok to make it in a separate CL becaus
horo
2014/06/03 05:10:47
Um...
I'm not so familiar with creating registrati
|
+ } |
infos.push_back(info); |
} |