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

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: Created 6 years, 10 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 92af988515594d1e840563372f7d8acf2ec5ea25..087ab45d7ceea864467fba9d3a81dc6de2d1fd97 100644
--- a/content/browser/service_worker/service_worker_storage.cc
+++ b/content/browser/service_worker/service_worker_storage.cc
@@ -9,6 +9,7 @@
#include "base/message_loop/message_loop.h"
#include "base/strings/string_util.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 {
@@ -80,6 +81,22 @@ void ServiceWorkerStorage::FindRegistrationForDocument(
RunSoon(base::Bind(callback, status, found));
}
+void ServiceWorkerStorage::FindAllRegistrations(
+ const FindAllRegistrationsCallback& callback) {
+ scoped_ptr<std::vector<ServiceWorkerRegistration*> > registrations =
+ make_scoped_ptr(new std::vector<ServiceWorkerRegistration*>);
+ for (PatternToRegistrationMap::const_iterator it =
+ registration_by_pattern_.begin();
+ it != registration_by_pattern_.end();
+ ++it) {
+ registrations->push_back(it->second);
+ }
+
+ BrowserThread::PostTask(BrowserThread::IO,
+ FROM_HERE,
+ base::Bind(callback, base::Passed(&registrations)));
+}
+
void ServiceWorkerStorage::StoreRegistration(
ServiceWorkerRegistration* registration,
const StatusCallback& callback) {

Powered by Google App Engine
This is Rietveld 408576698