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

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

Issue 189253002: Implement ServiceWorker::postMessage() [Chromium] (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rename message handler per review feedback 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 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) {
« no previous file with comments | « content/browser/service_worker/service_worker_storage.h ('k') | content/child/service_worker/service_worker_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698