Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / content / child / service_worker / web_service_worker_provider_impl.h
blob3d607bf98a76ea84094255a93e61862b41448575
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"
12 namespace blink {
13 class WebURL;
14 class WebServiceWorkerProviderClient;
17 namespace content {
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) {
27 public:
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;
45 private:
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_