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..689fddb7e942c2ce7dfa3ae90a8f792d2081ecb0 100644 |
--- a/content/browser/service_worker/service_worker_storage.cc |
+++ b/content/browser/service_worker/service_worker_storage.cc |
@@ -80,6 +80,24 @@ void ServiceWorkerStorage::FindRegistrationForDocument( |
RunSoon(base::Bind(callback, status, found)); |
} |
+void ServiceWorkerStorage::FindRegistrationForId( |
+ int64 registration_id, |
+ const FindRegistrationCallback& callback) { |
+ ServiceWorkerStatusCode status = SERVICE_WORKER_ERROR_NOT_FOUND; |
+ scoped_refptr<ServiceWorkerRegistration> found; |
+ for (PatternToRegistrationMap::const_iterator it = |
+ registration_by_pattern_.begin(); |
+ it != registration_by_pattern_.end(); |
+ ++it) { |
+ if (registration_id == it->second->id()) { |
+ status = SERVICE_WORKER_OK; |
+ found = it->second; |
+ break; |
+ } |
+ } |
+ RunSoon(base::Bind(callback, status, found)); |
+} |
+ |
void ServiceWorkerStorage::StoreRegistration( |
ServiceWorkerRegistration* registration, |
const StatusCallback& callback) { |