GPU workaround to simulate Out of Memory errors with large textures
[chromium-blink-merge.git] / content / child / service_worker / web_service_worker_provider_impl.h
blob37e99b1ae0f7d3aa7b075150349faacb66a19f4b
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*);
38 virtual void unregisterServiceWorker(
39 const blink::WebURL& pattern,
40 WebServiceWorkerUnregistrationCallbacks*);
42 virtual void getRegistration(const blink::WebURL& document_url,
43 WebServiceWorkerGetRegistrationCallbacks*);
44 virtual void getRegistrationForReady(
45 WebServiceWorkerGetRegistrationForReadyCallbacks*);
47 private:
48 void RemoveProviderClient();
49 ServiceWorkerDispatcher* GetDispatcher();
51 scoped_refptr<ThreadSafeSender> thread_safe_sender_;
52 scoped_refptr<ServiceWorkerProviderContext> context_;
54 DISALLOW_COPY_AND_ASSIGN(WebServiceWorkerProviderImpl);
57 } // namespace content
59 #endif // CONTENT_CHILD_SERVICE_WORKER_WEB_SERVICE_WORKER_PROVIDER_IMPL_H_