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

Unified Diff: content/child/service_worker/service_worker_dispatcher.h

Issue 477593007: ServiceWorker: Make '.ready' return a promise to be resolved with ServiceWorkerRegistration (2/3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 3 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/child/service_worker/service_worker_dispatcher.h
diff --git a/content/child/service_worker/service_worker_dispatcher.h b/content/child/service_worker/service_worker_dispatcher.h
index 6ff4fa5bf0d6c61ad63fc5c68d64fd5803dfeba2..579f0c9d3828303307fbfbbfb92883c4ff0e0859 100644
--- a/content/child/service_worker/service_worker_dispatcher.h
+++ b/content/child/service_worker/service_worker_dispatcher.h
@@ -96,12 +96,19 @@ class ServiceWorkerDispatcher : public WorkerTaskRunner::Observer {
const ServiceWorkerObjectInfo& info,
bool adopt_handle);
- // If an existing WebServiceWorkerRegistrationImpl exists for the
- // registration, it is returned; otherwise a WebServiceWorkerRegistrationImpl
- // is created and its ownership is transferred to the caller. If
- // |adopt_handle| is true, a ServiceWorkerRegistrationHandleReference will be
- // adopted for the specified registration.
- WebServiceWorkerRegistrationImpl* GetServiceWorkerRegistration(
+ // Finds a WebServiceWorkerRegistrationImpl for the specified registration.
+ // If it's not found, returns NULL. If |adopt_handle| is true,
+ // a ServiceWorkerRegistrationHandleReference will be adopted for the
+ // registration.
+ WebServiceWorkerRegistrationImpl* FindServiceWorkerRegistration(
+ const ServiceWorkerRegistrationObjectInfo& info,
+ bool adopt_handle);
+
+ // Creates a WebServiceWorkerRegistrationImpl for the specified registration
+ // and transfers its ownership to the caller. If |adopt_handle| is true, a
+ // ServiceWorkerRegistrationHandleReference will be adopted for the
+ // registration.
+ WebServiceWorkerRegistrationImpl* CreateServiceWorkerRegistration(
const ServiceWorkerRegistrationObjectInfo& info,
bool adopt_handle);
@@ -132,6 +139,12 @@ class ServiceWorkerDispatcher : public WorkerTaskRunner::Observer {
// WorkerTaskRunner::Observer implementation.
virtual void OnWorkerRunLoopStopped() OVERRIDE;
+ void OnAssociateRegistration(int thread_id,
+ int provider_id,
+ const ServiceWorkerRegistrationObjectInfo& info,
+ const ServiceWorkerVersionAttributes& attrs);
+ void OnDisassociateRegistration(int thread_id,
+ int provider_id);
void OnRegistered(int thread_id,
int request_id,
const ServiceWorkerRegistrationObjectInfo& info,
@@ -177,6 +190,9 @@ class ServiceWorkerDispatcher : public WorkerTaskRunner::Observer {
int provider_id,
int registration_handle_id,
const ServiceWorkerObjectInfo& info);
+ void SetReadyRegistration(
+ int provider_id,
+ int registration_handle_id);
// Keeps map from handle_id to ServiceWorker object.
void AddServiceWorker(int handle_id, WebServiceWorkerImpl* worker);

Powered by Google App Engine
This is Rietveld 408576698