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(®istrations))); |
+} |
+ |
void ServiceWorkerStorage::StoreRegistration( |
ServiceWorkerRegistration* registration, |
const StatusCallback& callback) { |