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 ServiceWorkerRegistration_h | 5 #ifndef ServiceWorkerRegistration_h |
6 #define ServiceWorkerRegistration_h | 6 #define ServiceWorkerRegistration_h |
7 | 7 |
8 #include "core/dom/ActiveDOMObject.h" | 8 #include "core/dom/ActiveDOMObject.h" |
9 #include "core/events/EventTarget.h" | 9 #include "core/events/EventTarget.h" |
10 #include "modules/serviceworkers/ServiceWorker.h" | 10 #include "modules/serviceworkers/ServiceWorker.h" |
| 11 #include "modules/serviceworkers/ServiceWorkerRegistration.h" |
11 #include "platform/Supplementable.h" | 12 #include "platform/Supplementable.h" |
12 #include "public/platform/WebServiceWorkerRegistration.h" | 13 #include "public/platform/WebServiceWorkerRegistration.h" |
13 #include "public/platform/WebServiceWorkerRegistrationProxy.h" | 14 #include "public/platform/WebServiceWorkerRegistrationProxy.h" |
14 #include "wtf/OwnPtr.h" | 15 #include "wtf/OwnPtr.h" |
15 #include "wtf/PassOwnPtr.h" | 16 #include "wtf/PassOwnPtr.h" |
16 #include "wtf/PassRefPtr.h" | 17 #include "wtf/PassRefPtr.h" |
17 #include "wtf/RefCounted.h" | 18 #include "wtf/RefCounted.h" |
18 | 19 |
19 namespace blink { | 20 namespace blink { |
20 | 21 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 | 77 |
77 OwnPtr<WebServiceWorkerRegistration> m_outerRegistration; | 78 OwnPtr<WebServiceWorkerRegistration> m_outerRegistration; |
78 WebServiceWorkerProvider* m_provider; | 79 WebServiceWorkerProvider* m_provider; |
79 RefPtrWillBeMember<ServiceWorker> m_installing; | 80 RefPtrWillBeMember<ServiceWorker> m_installing; |
80 RefPtrWillBeMember<ServiceWorker> m_waiting; | 81 RefPtrWillBeMember<ServiceWorker> m_waiting; |
81 RefPtrWillBeMember<ServiceWorker> m_active; | 82 RefPtrWillBeMember<ServiceWorker> m_active; |
82 | 83 |
83 bool m_stopped; | 84 bool m_stopped; |
84 }; | 85 }; |
85 | 86 |
| 87 class ServiceWorkerRegistrationArray { |
| 88 public: |
| 89 typedef WebVector<WebServiceWorkerRegistration*> WebType; |
| 90 static HeapVector<Member<ServiceWorkerRegistration>> take(ScriptPromiseResol
ver* resolver, WebType* webServiceWorkerRegistrationsRaw) |
| 91 { |
| 92 OwnPtr<WebType> webServiceWorkerRegistrations = adoptPtr(webServiceWorke
rRegistrationsRaw); |
| 93 HeapVector<Member<ServiceWorkerRegistration>> registrations; |
| 94 for (size_t i = 0; i < webServiceWorkerRegistrations->size(); ++i) { |
| 95 registrations.append(ServiceWorkerRegistration::take(resolver, (*web
ServiceWorkerRegistrations)[i])); |
| 96 } |
| 97 return registrations; |
| 98 } |
| 99 static void dispose(WebType* webServiceWorkerRegistrationsRaw) |
| 100 { |
| 101 delete webServiceWorkerRegistrationsRaw; |
| 102 } |
| 103 |
| 104 private: |
| 105 WTF_MAKE_NONCOPYABLE(ServiceWorkerRegistrationArray); |
| 106 ServiceWorkerRegistrationArray() = delete; |
| 107 }; |
| 108 |
86 } // namespace blink | 109 } // namespace blink |
87 | 110 |
88 #endif // ServiceWorkerRegistration_h | 111 #endif // ServiceWorkerRegistration_h |
OLD | NEW |