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/dom/ContextLifecycleObserver.h" | |
9 #include "core/frame/Navigator.h" | 8 #include "core/frame/Navigator.h" |
10 #include "modules/ModulesExport.h" | 9 #include "modules/ModulesExport.h" |
11 #include "platform/Supplementable.h" | 10 #include "platform/Supplementable.h" |
12 #include "platform/heap/Handle.h" | 11 #include "platform/heap/Handle.h" |
13 | 12 |
14 namespace blink { | 13 namespace blink { |
15 | 14 |
16 class Document; | 15 class Document; |
17 class ExceptionState; | 16 class ExceptionState; |
18 class Navigator; | 17 class Navigator; |
19 class ServiceWorkerContainer; | 18 class ServiceWorkerContainer; |
20 | 19 |
21 class MODULES_EXPORT NavigatorServiceWorker final : public GarbageCollected<Navi
gatorServiceWorker>, public Supplement<Navigator>, public ContextLifecycleObserv
er { | 20 class MODULES_EXPORT NavigatorServiceWorker final : public GarbageCollected<Navi
gatorServiceWorker>, public Supplement<Navigator>, public DOMWindowProperty { |
22 USING_GARBAGE_COLLECTED_MIXIN(NavigatorServiceWorker); | 21 USING_GARBAGE_COLLECTED_MIXIN(NavigatorServiceWorker); |
23 public: | 22 public: |
24 static NavigatorServiceWorker* from(Document&); | 23 static NavigatorServiceWorker* from(Document&); |
25 static NavigatorServiceWorker& from(Navigator&); | 24 static NavigatorServiceWorker& from(Navigator&); |
26 static NavigatorServiceWorker* toNavigatorServiceWorker(Navigator&); | 25 static NavigatorServiceWorker* toNavigatorServiceWorker(Navigator&); |
27 static ServiceWorkerContainer* serviceWorker(ExecutionContext*, Navigator&,
ExceptionState&); | 26 static ServiceWorkerContainer* serviceWorker(ExecutionContext*, Navigator&,
ExceptionState&); |
28 | 27 |
29 DECLARE_VIRTUAL_TRACE(); | 28 DECLARE_VIRTUAL_TRACE(); |
30 | 29 |
31 private: | 30 private: |
32 explicit NavigatorServiceWorker(Navigator&); | 31 explicit NavigatorServiceWorker(Navigator&); |
33 ServiceWorkerContainer* serviceWorker(LocalFrame*, ExceptionState&); | 32 ServiceWorkerContainer* serviceWorker(ExceptionState&); |
34 | 33 |
35 static const char* supplementName(); | 34 static const char* supplementName(); |
36 | 35 |
37 // ContextLifecycleObserver override. | 36 // DOMWindowProperty override. |
38 void contextDestroyed() override; | 37 void willDetachGlobalObjectFromFrame() override; |
39 | 38 |
40 Member<ServiceWorkerContainer> m_serviceWorker; | 39 Member<ServiceWorkerContainer> m_serviceWorker; |
41 }; | 40 }; |
42 | 41 |
43 } // namespace blink | 42 } // namespace blink |
44 | 43 |
45 #endif // NavigatorServiceWorker_h | 44 #endif // NavigatorServiceWorker_h |
OLD | NEW |