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

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

Issue 354643003: ServiceWorker: Support navigator.serviceWorker.active (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 672bd7c9a727195e2fbbf5967011b82d26e89b11..ee294d99293a7297c9df4da71a058b32c8587b52 100644
--- a/content/child/service_worker/service_worker_provider_context.h
+++ b/content/child/service_worker/service_worker_provider_context.h
@@ -44,6 +44,8 @@ class ServiceWorkerProviderContext
const ServiceWorkerObjectInfo& info);
void OnSetWaitingServiceWorker(int provider_id,
const ServiceWorkerObjectInfo& info);
+ void OnSetActiveServiceWorker(int provider_id,
+ const ServiceWorkerObjectInfo& info);
void OnSetControllerServiceWorker(int provider_id,
const ServiceWorkerObjectInfo& info);
@@ -51,6 +53,7 @@ class ServiceWorkerProviderContext
ServiceWorkerHandleReference* installing();
ServiceWorkerHandleReference* waiting();
+ ServiceWorkerHandleReference* active();
ServiceWorkerHandleReference* controller();
// Gets the handle ID of the installing Service Worker, or
@@ -63,7 +66,12 @@ class ServiceWorkerProviderContext
// waiting Service Worker.
int waiting_handle_id() const;
- // Gets the handle ID of the controller, or
+ // Gets the handle ID of the active Service Worker, or
+ // kInvalidServiceWorkerHandleId if the provider does not have an active
+ // Service Worker.
+ int active_handle_id() const;
+
+ // Gets the handle ID of the controller Service Worker, or
// kInvalidServiceWorkerHandleId if the provider is not controlled
// by a Service Worker.
int controller_handle_id() const;
@@ -77,6 +85,7 @@ class ServiceWorkerProviderContext
scoped_refptr<ThreadSafeSender> thread_safe_sender_;
scoped_ptr<ServiceWorkerHandleReference> installing_;
scoped_ptr<ServiceWorkerHandleReference> waiting_;
+ scoped_ptr<ServiceWorkerHandleReference> active_;
scoped_ptr<ServiceWorkerHandleReference> controller_;
DISALLOW_COPY_AND_ASSIGN(ServiceWorkerProviderContext);

Powered by Google App Engine
This is Rietveld 408576698