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

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

Issue 304543002: Show the unregistered workers in chrome://serviceworker-internals and chrome://inspect (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Pass live_registrations to chrome://inspect. 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
Index: content/browser/service_worker/service_worker_context_core.cc
diff --git a/content/browser/service_worker/service_worker_context_core.cc b/content/browser/service_worker/service_worker_context_core.cc
index cbd6ce62bdd8db98b1bbe881fb7351f5f643336a..569ee9e98b2ad10739429cb1b9de9814ed75ce42 100644
--- a/content/browser/service_worker/service_worker_context_core.cc
+++ b/content/browser/service_worker/service_worker_context_core.cc
@@ -242,6 +242,30 @@ void ServiceWorkerContextCore::RemoveLiveVersion(int64 id) {
live_versions_.erase(id);
}
+std::vector<ServiceWorkerRegistrationInfo>
+ServiceWorkerContextCore::GetAllLiveRegistrationInfo() {
+ std::vector<ServiceWorkerRegistrationInfo> infos;
+ for (std::map<int64, ServiceWorkerRegistration*>::const_iterator iter =
+ live_registrations_.begin();
+ iter != live_registrations_.end();
+ ++iter) {
+ infos.push_back(iter->second->GetInfo());
+ }
+ return infos;
+}
+
+std::vector<ServiceWorkerVersionInfo>
+ServiceWorkerContextCore::GetAllLiveVersionInfo() {
+ std::vector<ServiceWorkerVersionInfo> infos;
+ for (std::map<int64, ServiceWorkerVersion*>::const_iterator iter =
+ live_versions_.begin();
+ iter != live_versions_.end();
+ ++iter) {
+ infos.push_back(iter->second->GetInfo());
+ }
+ return infos;
+}
+
int ServiceWorkerContextCore::GetNewServiceWorkerHandleId() {
return next_handle_id_++;
}

Powered by Google App Engine
This is Rietveld 408576698