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

Unified Diff: content/child/service_worker/service_worker_provider_context.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: 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_provider_context.h
diff --git a/content/child/service_worker/service_worker_provider_context.h b/content/child/service_worker/service_worker_provider_context.h
index ee294d99293a7297c9df4da71a058b32c8587b52..48fd59b2118b05bd36ec5aa868fa81ae96cf8296 100644
--- a/content/child/service_worker/service_worker_provider_context.h
+++ b/content/child/service_worker/service_worker_provider_context.h
@@ -24,6 +24,7 @@ class Message;
namespace content {
class ServiceWorkerHandleReference;
+class ServiceWorkerRegistrationHandleReference;
struct ServiceWorkerProviderContextDeleter;
class ThreadSafeSender;
@@ -49,6 +50,9 @@ class ServiceWorkerProviderContext
void OnSetControllerServiceWorker(int provider_id,
const ServiceWorkerObjectInfo& info);
+ void AssociateRegistration(const ServiceWorkerRegistrationObjectInfo& info);
+ void UnassociateRegistration();
+
int provider_id() const { return provider_id_; }
ServiceWorkerHandleReference* installing();
@@ -56,6 +60,8 @@ class ServiceWorkerProviderContext
ServiceWorkerHandleReference* active();
ServiceWorkerHandleReference* controller();
+ ServiceWorkerRegistrationHandleReference* registration();
+
// Gets the handle ID of the installing Service Worker, or
// kInvalidServiceWorkerHandleId if the provider does not have a
// installing Service Worker.
@@ -76,6 +82,11 @@ class ServiceWorkerProviderContext
// by a Service Worker.
int controller_handle_id() const;
+ // Gets the handle ID of the associated registration, or
+ // kInvalidRegistrationHandleId if the provider does not have a ready
+ // Service Worker registration.
+ int registration_handle_id() const;
+
private:
friend class base::RefCounted<ServiceWorkerProviderContext>;
~ServiceWorkerProviderContext();
@@ -88,6 +99,8 @@ class ServiceWorkerProviderContext
scoped_ptr<ServiceWorkerHandleReference> active_;
scoped_ptr<ServiceWorkerHandleReference> controller_;
+ scoped_ptr<ServiceWorkerRegistrationHandleReference> registration_;
+
DISALLOW_COPY_AND_ASSIGN(ServiceWorkerProviderContext);
};

Powered by Google App Engine
This is Rietveld 408576698