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

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

Issue 309503014: Make ServiceWorkerDispatcher reuse existing WebServiceWorkerImpls. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 b596b37483ca571407e576ff3e8c75ebcbfd1062..7bd74d1bf0b2110c44a55bda44c355b7630ce2a4 100644
--- a/content/child/service_worker/service_worker_dispatcher.h
+++ b/content/child/service_worker/service_worker_dispatcher.h
@@ -70,6 +70,22 @@ class ServiceWorkerDispatcher : public WorkerTaskRunner::Observer {
blink::WebServiceWorkerProviderClient* client);
void RemoveScriptClient(int provider_id);
+ // If an existing WebServiceWorkerImpl exists for the Service
michaeln 2014/06/02 21:11:19 fyi: eventually, i think we'll have consumers of t
+ // Worker, it is returned; otherwise a WebServiceWorkerImpl is
+ // created and its ownership is transferred caller. If
falken 2014/06/02 05:40:11 transferred to the caller
+ // |adopt_handle| is true, a ServiceWorkerHandleReference will be
+ // adopted for the specified Service Worker.
+ //
+ // TODO(dominicc): The lifetime of WebServiceWorkerImpl is too tricky; this
michaeln 2014/06/02 21:11:19 how does the caller know when ownership is transfe
+ // method can return an existing WebServiceWorkerImpl, in which case
+ // it is owned by a WebCore::ServiceWorker and the lifetime is not
+ // being transferred to the owner; or it can create a
+ // WebServiceWorkerImpl, in which case ownership is transferred to
+ // the caller who must bounce it to a method that will associate it
+ // with a WebCore::ServiceWorker.
+ WebServiceWorkerImpl* GetServiceWorker(const ServiceWorkerObjectInfo&,
+ bool adopt_handle);
+
// |thread_safe_sender| needs to be passed in because if the call leads to
// construction it will be needed.
static ServiceWorkerDispatcher* GetOrCreateThreadSpecificInstance(

Powered by Google App Engine
This is Rietveld 408576698