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

Unified Diff: content/browser/service_worker/service_worker_storage.cc

Issue 307223003: Fills the info about the live versions which aren't in the live registrations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: omit bracket Created 6 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..b731c69440723a49336802db6c1af69a6d471381 100644
--- a/content/browser/service_worker/service_worker_storage.cc
+++ b/content/browser/service_worker/service_worker_storage.cc
@@ -579,12 +579,20 @@ 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();
+ } 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;
+ }
infos.push_back(info);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698