| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 ServiceWorkerContainerClient_h | 5 #ifndef ServiceWorkerContainerClient_h |
| 6 #define ServiceWorkerContainerClient_h | 6 #define ServiceWorkerContainerClient_h |
| 7 | 7 |
| 8 #include "core/dom/DocumentSupplementable.h" | 8 #include "core/dom/DocumentSupplementable.h" |
| 9 #include "core/workers/WorkerClients.h" | 9 #include "core/workers/WorkerClients.h" |
| 10 #include "wtf/Forward.h" | 10 #include "wtf/Forward.h" |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 | 13 |
| 14 class ExecutionContext; | 14 class ExecutionContext; |
| 15 class WebServiceWorkerProvider; | 15 class WebServiceWorkerProvider; |
| 16 | 16 |
| 17 // This mainly exists to provide access to WebServiceWorkerProvider. | 17 // This mainly exists to provide access to WebServiceWorkerProvider. |
| 18 // Owned by Document (or WorkerClients). | 18 // Owned by Document (or WorkerClients). |
| 19 class ServiceWorkerContainerClient FINAL | 19 class ServiceWorkerContainerClient final |
| 20 : public NoBaseWillBeGarbageCollectedFinalized<ServiceWorkerContainerClient> | 20 : public NoBaseWillBeGarbageCollectedFinalized<ServiceWorkerContainerClient> |
| 21 , public DocumentSupplement | 21 , public DocumentSupplement |
| 22 , public WillBeHeapSupplement<WorkerClients> { | 22 , public WillBeHeapSupplement<WorkerClients> { |
| 23 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ServiceWorkerContainerClient); | 23 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ServiceWorkerContainerClient); |
| 24 WTF_MAKE_NONCOPYABLE(ServiceWorkerContainerClient); | 24 WTF_MAKE_NONCOPYABLE(ServiceWorkerContainerClient); |
| 25 public: | 25 public: |
| 26 static PassOwnPtrWillBeRawPtr<ServiceWorkerContainerClient> create(PassOwnPt
r<WebServiceWorkerProvider>); | 26 static PassOwnPtrWillBeRawPtr<ServiceWorkerContainerClient> create(PassOwnPt
r<WebServiceWorkerProvider>); |
| 27 virtual ~ServiceWorkerContainerClient(); | 27 virtual ~ServiceWorkerContainerClient(); |
| 28 | 28 |
| 29 WebServiceWorkerProvider* provider() { return m_provider.get(); } | 29 WebServiceWorkerProvider* provider() { return m_provider.get(); } |
| 30 | 30 |
| 31 static const char* supplementName(); | 31 static const char* supplementName(); |
| 32 static ServiceWorkerContainerClient* from(ExecutionContext*); | 32 static ServiceWorkerContainerClient* from(ExecutionContext*); |
| 33 | 33 |
| 34 virtual void trace(Visitor* visitor) OVERRIDE | 34 virtual void trace(Visitor* visitor) override |
| 35 { | 35 { |
| 36 DocumentSupplement::trace(visitor); | 36 DocumentSupplement::trace(visitor); |
| 37 WillBeHeapSupplement<WorkerClients>::trace(visitor); | 37 WillBeHeapSupplement<WorkerClients>::trace(visitor); |
| 38 } | 38 } |
| 39 | 39 |
| 40 protected: | 40 protected: |
| 41 explicit ServiceWorkerContainerClient(PassOwnPtr<WebServiceWorkerProvider>); | 41 explicit ServiceWorkerContainerClient(PassOwnPtr<WebServiceWorkerProvider>); |
| 42 | 42 |
| 43 OwnPtr<WebServiceWorkerProvider> m_provider; | 43 OwnPtr<WebServiceWorkerProvider> m_provider; |
| 44 }; | 44 }; |
| 45 | 45 |
| 46 void provideServiceWorkerContainerClientToWorker(WorkerClients*, PassOwnPtr<WebS
erviceWorkerProvider>); | 46 void provideServiceWorkerContainerClientToWorker(WorkerClients*, PassOwnPtr<WebS
erviceWorkerProvider>); |
| 47 | 47 |
| 48 } // namespace blink | 48 } // namespace blink |
| 49 | 49 |
| 50 #endif // ServiceWorkerContainerClient_h | 50 #endif // ServiceWorkerContainerClient_h |
| OLD | NEW |