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 "bindings/v8/ScriptPromise.h" |
8 #include "core/frame/Navigator.h" | 9 #include "core/frame/Navigator.h" |
9 #include "platform/Supplementable.h" | 10 #include "platform/Supplementable.h" |
10 #include "platform/heap/Handle.h" | 11 #include "platform/heap/Handle.h" |
11 | 12 |
12 namespace WebCore { | 13 namespace WebCore { |
13 | 14 |
14 class Document; | |
15 class Navigator; | 15 class Navigator; |
16 class ServiceWorkerContainer; | 16 class ServiceWorkerContainer; |
17 | 17 |
18 class NavigatorServiceWorker FINAL : public NoBaseWillBeGarbageCollectedFinalize
d<NavigatorServiceWorker>, public WillBeHeapSupplement<Navigator>, DOMWindowProp
erty { | 18 class NavigatorServiceWorker FINAL : public NoBaseWillBeGarbageCollectedFinalize
d<NavigatorServiceWorker>, public WillBeHeapSupplement<Navigator>, DOMWindowProp
erty { |
19 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(NavigatorServiceWorker); | 19 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(NavigatorServiceWorker); |
20 public: | 20 public: |
21 virtual ~NavigatorServiceWorker(); | 21 virtual ~NavigatorServiceWorker(); |
22 static NavigatorServiceWorker* from(Document&); | |
23 static NavigatorServiceWorker& from(Navigator&); | 22 static NavigatorServiceWorker& from(Navigator&); |
24 static NavigatorServiceWorker* toNavigatorServiceWorker(Navigator&); | 23 static NavigatorServiceWorker* toNavigatorServiceWorker(Navigator&); |
25 static const char* supplementName(); | 24 static const char* supplementName(); |
26 | 25 |
27 static ServiceWorkerContainer* serviceWorker(Navigator&); | 26 static ServiceWorkerContainer* serviceWorker(Navigator&); |
28 | 27 |
29 void trace(Visitor*) { } | 28 void trace(Visitor*) { } |
30 | 29 |
31 private: | 30 private: |
32 explicit NavigatorServiceWorker(Navigator&); | 31 explicit NavigatorServiceWorker(Navigator&); |
33 ServiceWorkerContainer* serviceWorker(); | 32 ServiceWorkerContainer* serviceWorker(); |
34 | 33 |
35 // DOMWindowProperty override. | 34 // DOMWindowProperty override. |
36 virtual void willDetachGlobalObjectFromFrame() OVERRIDE; | 35 virtual void willDetachGlobalObjectFromFrame() OVERRIDE; |
37 | 36 |
38 RefPtr<ServiceWorkerContainer> m_serviceWorker; | 37 RefPtr<ServiceWorkerContainer> m_serviceWorker; |
39 }; | 38 }; |
40 | 39 |
41 } // namespace WebCore | 40 } // namespace WebCore |
42 | 41 |
43 #endif // NavigatorServiceWorker_h | 42 #endif // NavigatorServiceWorker_h |
OLD | NEW |