Chromium Code Reviews| 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 "platform/Supplementable.h" | 9 #include "platform/Supplementable.h" |
| 10 #include "platform/heap/Handle.h" | 10 #include "platform/heap/Handle.h" |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 | 13 |
| 14 class Document; | 14 class Document; |
| 15 class Navigator; | 15 class Navigator; |
| 16 class DOMWindow; | |
| 16 class ServiceWorkerContainer; | 17 class ServiceWorkerContainer; |
| 17 | 18 |
| 18 class NavigatorServiceWorker final : public NoBaseWillBeGarbageCollected<Navigat orServiceWorker>, public WillBeHeapSupplement<Navigator>, DOMWindowProperty { | 19 class NavigatorServiceWorker final : public NoBaseWillBeGarbageCollected<Navigat orServiceWorker>, public WillBeHeapSupplement<Navigator>, DOMWindowProperty { |
| 19 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(NavigatorServiceWorker); | 20 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(NavigatorServiceWorker); |
| 20 DECLARE_EMPTY_VIRTUAL_DESTRUCTOR_WILL_BE_REMOVED(NavigatorServiceWorker); | 21 DECLARE_EMPTY_VIRTUAL_DESTRUCTOR_WILL_BE_REMOVED(NavigatorServiceWorker); |
| 21 public: | 22 public: |
| 22 static NavigatorServiceWorker* from(Document&); | 23 static NavigatorServiceWorker* from(Document&); |
| 23 static NavigatorServiceWorker& from(Navigator&); | 24 static NavigatorServiceWorker& from(Navigator&); |
| 24 static NavigatorServiceWorker* toNavigatorServiceWorker(Navigator&); | 25 static NavigatorServiceWorker* toNavigatorServiceWorker(Navigator&); |
| 25 static const char* supplementName(); | 26 static const char* supplementName(); |
| 26 | 27 |
| 27 static ServiceWorkerContainer* serviceWorker(Navigator&); | 28 static ServiceWorkerContainer* serviceWorker(Navigator&); |
| 28 | 29 |
| 29 virtual void trace(Visitor*) override; | 30 virtual void trace(Visitor*) override; |
| 30 | 31 |
| 31 private: | 32 private: |
| 32 explicit NavigatorServiceWorker(Navigator&); | 33 explicit NavigatorServiceWorker(Navigator&); |
| 33 ServiceWorkerContainer* serviceWorker(); | 34 ServiceWorkerContainer* serviceWorker(); |
| 34 | 35 |
| 35 // DOMWindowProperty override. | 36 // DOMWindowProperty override. |
| 36 virtual void willDetachGlobalObjectFromFrame() override; | 37 virtual void willDetachGlobalObjectFromFrame() override; |
| 37 | 38 |
| 38 PersistentWillBeMember<ServiceWorkerContainer> m_serviceWorker; | 39 PersistentWillBeMember<ServiceWorkerContainer> m_serviceWorker; |
| 40 RefPtrWillBeMember<DOMWindow> m_domWindow; | |
|
dominicc (has gone to gerrit)
2015/01/19 03:19:08
Could this cause a leak by creating a cycle includ
| |
| 39 }; | 41 }; |
| 40 | 42 |
| 41 } // namespace blink | 43 } // namespace blink |
| 42 | 44 |
| 43 #endif // NavigatorServiceWorker_h | 45 #endif // NavigatorServiceWorker_h |
| OLD | NEW |