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 724b243f32293412126d22b2b21c4565119d6586..5be0fbbc771af7de1a92d3772948e5804d830b77 100644 |
--- a/content/browser/service_worker/service_worker_storage.cc |
+++ b/content/browser/service_worker/service_worker_storage.cc |
@@ -97,6 +97,24 @@ void ServiceWorkerStorage::GetAllRegistrations( |
BrowserThread::IO, FROM_HERE, base::Bind(callback, registrations)); |
} |
+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) { |