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

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

Issue 317953004: Set the "waiting" Service Worker of Service Worker providers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Bring patch to head. Created 6 years, 6 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 47a300325096d4240f485a0c44635219fd4215ab..5fe68ae6c55f68ca67d3d015e28476a031b3feed 100644
--- a/content/child/service_worker/service_worker_provider_context.h
+++ b/content/child/service_worker/service_worker_provider_context.h
@@ -40,11 +40,14 @@ class ServiceWorkerProviderContext
// Called from ServiceWorkerDispatcher.
void OnServiceWorkerStateChanged(int handle_id,
blink::WebServiceWorkerState state);
+ void OnSetWaitingServiceWorker(int provider_id,
+ const ServiceWorkerObjectInfo& info);
void OnSetCurrentServiceWorker(int provider_id,
const ServiceWorkerObjectInfo& info);
int provider_id() const { return provider_id_; }
+ ServiceWorkerHandleReference* waiting();
// Gets the context's handle reference for .controller.
// TODO(dominicc): Rename this to "controller".
ServiceWorkerHandleReference* current();
@@ -54,6 +57,11 @@ class ServiceWorkerProviderContext
// by a Service Worker.
int current_handle_id() const;
+ // Gets the handle ID of the waiting Service Worker, or
+ // kInvalidServiceWorkerHandleId if the provider does not have a
+ // waiting Service Worker.
+ int waiting_handle_id() const;
+
private:
friend class base::RefCounted<ServiceWorkerProviderContext>;
~ServiceWorkerProviderContext();
@@ -61,6 +69,7 @@ class ServiceWorkerProviderContext
const int provider_id_;
scoped_refptr<base::MessageLoopProxy> main_thread_loop_proxy_;
scoped_refptr<ThreadSafeSender> thread_safe_sender_;
+ scoped_ptr<ServiceWorkerHandleReference> waiting_;
scoped_ptr<ServiceWorkerHandleReference> current_;
DISALLOW_COPY_AND_ASSIGN(ServiceWorkerProviderContext);

Powered by Google App Engine
This is Rietveld 408576698