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

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

Issue 182383008: Create chrome://serviceworker-internals (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update to ToT Created 6 years, 9 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_storage.cc
diff --git a/content/browser/service_worker/service_worker_storage.cc b/content/browser/service_worker/service_worker_storage.cc
index 0be7089ef05ccfe24f508a91810de7bfa20c3648..724b243f32293412126d22b2b21c4565119d6586 100644
--- a/content/browser/service_worker/service_worker_storage.cc
+++ b/content/browser/service_worker/service_worker_storage.cc
@@ -5,10 +5,11 @@
#include "content/browser/service_worker/service_worker_storage.h"
#include <string>
-
#include "base/message_loop/message_loop.h"
#include "base/strings/string_util.h"
+#include "content/browser/service_worker/service_worker_info.h"
#include "content/browser/service_worker/service_worker_registration.h"
+#include "content/public/browser/browser_thread.h"
#include "webkit/browser/quota/quota_manager_proxy.h"
namespace content {
@@ -81,6 +82,21 @@ void ServiceWorkerStorage::FindRegistrationForDocument(
RunSoon(base::Bind(callback, status, found));
}
+void ServiceWorkerStorage::GetAllRegistrations(
+ const GetAllRegistrationInfosCallback& callback) {
+ std::vector<ServiceWorkerRegistrationInfo> registrations;
+ for (PatternToRegistrationMap::const_iterator it =
+ registration_by_pattern_.begin();
+ it != registration_by_pattern_.end();
+ ++it) {
+ ServiceWorkerRegistration* registration(it->second.get());
+ registrations.push_back(registration->GetInfo());
+ }
+
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE, base::Bind(callback, registrations));
+}
+
void ServiceWorkerStorage::StoreRegistration(
ServiceWorkerRegistration* registration,
const StatusCallback& callback) {
« no previous file with comments | « content/browser/service_worker/service_worker_storage.h ('k') | content/browser/service_worker/service_worker_version.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698