OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_CHILD_SERVICE_WORKER_WEB_SERVICE_WORKER_PROVIDER_IMPL_H_ | 5 #ifndef CONTENT_CHILD_SERVICE_WORKER_WEB_SERVICE_WORKER_PROVIDER_IMPL_H_ |
6 #define CONTENT_CHILD_SERVICE_WORKER_WEB_SERVICE_WORKER_PROVIDER_IMPL_H_ | 6 #define CONTENT_CHILD_SERVICE_WORKER_WEB_SERVICE_WORKER_PROVIDER_IMPL_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "third_party/WebKit/public/platform/WebServiceWorkerProvider.h" | 11 #include "third_party/WebKit/public/platform/WebServiceWorkerProvider.h" |
12 | 12 |
13 namespace blink { | 13 namespace blink { |
14 class WebURL; | 14 class WebURL; |
15 class WebServiceWorkerProviderClient; | 15 class WebServiceWorkerProviderClient; |
16 } | 16 } |
17 | 17 |
18 namespace content { | 18 namespace content { |
19 | 19 |
20 class ServiceWorkerDispatcher; | 20 class ServiceWorkerDispatcher; |
| 21 class ServiceWorkerMessageSender; |
21 class ServiceWorkerProviderContext; | 22 class ServiceWorkerProviderContext; |
22 class ThreadSafeSender; | 23 class ThreadSafeSender; |
23 | 24 |
24 // This class corresponds to one ServiceWorkerContainer interface in | 25 // This class corresponds to one ServiceWorkerContainer interface in |
25 // JS context (i.e. navigator.serviceWorker). | 26 // JS context (i.e. navigator.serviceWorker). |
26 class WebServiceWorkerProviderImpl | 27 class WebServiceWorkerProviderImpl |
27 : NON_EXPORTED_BASE(public blink::WebServiceWorkerProvider) { | 28 : NON_EXPORTED_BASE(public blink::WebServiceWorkerProvider) { |
28 public: | 29 public: |
29 WebServiceWorkerProviderImpl(ThreadSafeSender* thread_safe_sender, | 30 WebServiceWorkerProviderImpl(ThreadSafeSender* thread_safe_sender, |
30 ServiceWorkerProviderContext* context); | 31 ServiceWorkerProviderContext* context); |
(...skipping 15 matching lines...) Expand all Loading... |
46 WebServiceWorkerGetRegistrationForReadyCallbacks*); | 47 WebServiceWorkerGetRegistrationForReadyCallbacks*); |
47 | 48 |
48 ServiceWorkerProviderContext* context() { return context_.get(); } | 49 ServiceWorkerProviderContext* context() { return context_.get(); } |
49 | 50 |
50 int provider_id() const { return provider_id_; } | 51 int provider_id() const { return provider_id_; } |
51 | 52 |
52 private: | 53 private: |
53 void RemoveProviderClient(); | 54 void RemoveProviderClient(); |
54 ServiceWorkerDispatcher* GetDispatcher(); | 55 ServiceWorkerDispatcher* GetDispatcher(); |
55 | 56 |
56 scoped_refptr<ThreadSafeSender> thread_safe_sender_; | 57 scoped_refptr<ServiceWorkerMessageSender> sender_; |
57 scoped_refptr<ServiceWorkerProviderContext> context_; | 58 scoped_refptr<ServiceWorkerProviderContext> context_; |
58 const int provider_id_; | 59 const int provider_id_; |
59 | 60 |
60 DISALLOW_COPY_AND_ASSIGN(WebServiceWorkerProviderImpl); | 61 DISALLOW_COPY_AND_ASSIGN(WebServiceWorkerProviderImpl); |
61 }; | 62 }; |
62 | 63 |
63 } // namespace content | 64 } // namespace content |
64 | 65 |
65 #endif // CONTENT_CHILD_SERVICE_WORKER_WEB_SERVICE_WORKER_PROVIDER_IMPL_H_ | 66 #endif // CONTENT_CHILD_SERVICE_WORKER_WEB_SERVICE_WORKER_PROVIDER_IMPL_H_ |
OLD | NEW |