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

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: 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 0be7089ef05ccfe24f508a91810de7bfa20c3648..debf67268a2be58a6fe7cea485997b76c6b0ec80 100644
--- a/content/browser/service_worker/service_worker_storage.cc
+++ b/content/browser/service_worker/service_worker_storage.cc
@@ -81,6 +81,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) {

Powered by Google App Engine
This is Rietveld 408576698