1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CONTENT_CHILD_SERVICE_WORKER_WEB_SERVICE_WORKER_PROVIDER_IMPL_H_
6 #define CONTENT_CHILD_SERVICE_WORKER_WEB_SERVICE_WORKER_PROVIDER_IMPL_H_
8 #include "base/compiler_specific.h"
9 #include "base/memory/ref_counted.h"
10 #include "third_party/WebKit/public/platform/WebServiceWorkerProvider.h"
14 class WebServiceWorkerProviderClient
;
19 class ServiceWorkerDispatcher
;
20 class ServiceWorkerProviderContext
;
21 class ThreadSafeSender
;
23 // This class corresponds to one ServiceWorkerContainer interface in
24 // JS context (i.e. navigator.serviceWorker).
25 class WebServiceWorkerProviderImpl
26 : NON_EXPORTED_BASE(public blink::WebServiceWorkerProvider
) {
28 WebServiceWorkerProviderImpl(ThreadSafeSender
* thread_safe_sender
,
29 ServiceWorkerProviderContext
* context
);
30 virtual ~WebServiceWorkerProviderImpl();
32 virtual void setClient(blink::WebServiceWorkerProviderClient
* client
);
34 virtual void registerServiceWorker(const blink::WebURL
& pattern
,
35 const blink::WebURL
& script_url
,
36 WebServiceWorkerRegistrationCallbacks
*);
37 virtual void getRegistration(const blink::WebURL
& document_url
,
38 WebServiceWorkerGetRegistrationCallbacks
*);
39 virtual void getRegistrations(WebServiceWorkerGetRegistrationsCallbacks
*);
40 virtual void getRegistrationForReady(
41 WebServiceWorkerGetRegistrationForReadyCallbacks
*);
43 int provider_id() const;
46 void RemoveProviderClient();
47 ServiceWorkerDispatcher
* GetDispatcher();
49 scoped_refptr
<ThreadSafeSender
> thread_safe_sender_
;
50 scoped_refptr
<ServiceWorkerProviderContext
> context_
;
52 DISALLOW_COPY_AND_ASSIGN(WebServiceWorkerProviderImpl
);
55 } // namespace content
57 #endif // CONTENT_CHILD_SERVICE_WORKER_WEB_SERVICE_WORKER_PROVIDER_IMPL_H_