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

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

Issue 182863004: Wire provider_id into scriptable API provider to start listening events (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 a3a1abce6e1c9d8b4117ef0b76e4987f073507c2..a0633e8adbe49678772069f104bc33c7112009bc 100644
--- a/content/child/service_worker/service_worker_dispatcher.h
+++ b/content/child/service_worker/service_worker_dispatcher.h
@@ -38,16 +38,24 @@ class ServiceWorkerDispatcher : public WorkerTaskRunner::Observer {
void OnMessageReceived(const IPC::Message& msg);
bool Send(IPC::Message* msg);
- // Corresponds to navigator.registerServiceWorker()
+ // Corresponds to navigator.serviceWorker.register()
void RegisterServiceWorker(
const GURL& pattern,
const GURL& script_url,
blink::WebServiceWorkerProvider::WebServiceWorkerCallbacks* callbacks);
- // Corresponds to navigator.unregisterServiceWorker()
+ // Corresponds to navigator.serviceWorker.unregister()
void UnregisterServiceWorker(
const GURL& pattern,
blink::WebServiceWorkerProvider::WebServiceWorkerCallbacks* callbacks);
+ // Called when navigator.serviceWorker is instantiated (or detached,
+ // when null client is given). This dispatcher is created one per thread
+ // and client is also expected to be added at most one per thread (in the
+ // current implementation).
+ void SetScriptClient(
+ int provider_id,
+ blink::WebServiceWorkerProviderClient* client);
+
// |thread_safe_sender| needs to be passed in because if the call leads to
// construction it will be needed.
static ServiceWorkerDispatcher* ThreadSpecificInstance(
@@ -71,6 +79,7 @@ class ServiceWorkerDispatcher : public WorkerTaskRunner::Observer {
IDMapOwnPointer> pending_callbacks_;
scoped_refptr<ThreadSafeSender> thread_safe_sender_;
+ blink::WebServiceWorkerProviderClient* client_;
DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDispatcher);
};

Powered by Google App Engine
This is Rietveld 408576698