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 NavigatorServiceWorker_h | 5 #ifndef NavigatorServiceWorker_h |
6 #define NavigatorServiceWorker_h | 6 #define NavigatorServiceWorker_h |
7 | 7 |
8 #include "core/frame/Navigator.h" | 8 #include "core/frame/Navigator.h" |
9 #include "modules/ModulesExport.h" | 9 #include "modules/ModulesExport.h" |
10 #include "platform/Supplementable.h" | 10 #include "platform/Supplementable.h" |
11 #include "platform/heap/Handle.h" | 11 #include "platform/heap/Handle.h" |
12 | 12 |
13 namespace blink { | 13 namespace blink { |
14 | 14 |
15 class Document; | 15 class Document; |
16 class Navigator; | 16 class Navigator; |
17 class ServiceWorkerContainer; | 17 class ServiceWorkerContainer; |
18 | 18 |
19 class MODULES_EXPORT NavigatorServiceWorker final : public NoBaseWillBeGarbageCo
llected<NavigatorServiceWorker>, public WillBeHeapSupplement<Navigator>, DOMWind
owProperty { | 19 class MODULES_EXPORT NavigatorServiceWorker final : public GarbageCollectedFinal
ized<NavigatorServiceWorker>, public HeapSupplement<Navigator>, DOMWindowPropert
y { |
20 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(NavigatorServiceWorker); | 20 USING_GARBAGE_COLLECTED_MIXIN(NavigatorServiceWorker); |
21 DECLARE_EMPTY_VIRTUAL_DESTRUCTOR_WILL_BE_REMOVED(NavigatorServiceWorker); | |
22 public: | 21 public: |
23 static NavigatorServiceWorker* from(Document&); | 22 static NavigatorServiceWorker* from(Document&); |
24 static NavigatorServiceWorker& from(Navigator&); | 23 static NavigatorServiceWorker& from(Navigator&); |
25 static NavigatorServiceWorker* toNavigatorServiceWorker(Navigator&); | 24 static NavigatorServiceWorker* toNavigatorServiceWorker(Navigator&); |
26 static const char* supplementName(); | 25 |
| 26 virtual ~NavigatorServiceWorker(); |
27 | 27 |
28 static ServiceWorkerContainer* serviceWorker(Navigator&); | 28 static ServiceWorkerContainer* serviceWorker(Navigator&); |
29 | 29 |
30 DECLARE_VIRTUAL_TRACE(); | 30 DECLARE_VIRTUAL_TRACE(); |
31 | 31 |
32 private: | 32 private: |
33 explicit NavigatorServiceWorker(Navigator&); | 33 explicit NavigatorServiceWorker(Navigator&); |
34 ServiceWorkerContainer* serviceWorker(); | 34 ServiceWorkerContainer* serviceWorker(); |
35 | 35 |
| 36 static const char* supplementName(); |
| 37 |
36 // DOMWindowProperty override. | 38 // DOMWindowProperty override. |
37 virtual void willDetachGlobalObjectFromFrame() override; | 39 virtual void willDetachGlobalObjectFromFrame() override; |
38 | 40 |
39 PersistentWillBeMember<ServiceWorkerContainer> m_serviceWorker; | 41 Member<ServiceWorkerContainer> m_serviceWorker; |
40 }; | 42 }; |
41 | 43 |
42 } // namespace blink | 44 } // namespace blink |
43 | 45 |
44 #endif // NavigatorServiceWorker_h | 46 #endif // NavigatorServiceWorker_h |
OLD | NEW |