Index: Source/modules/serviceworkers/ServiceWorkerRegistration.h |
diff --git a/Source/modules/serviceworkers/ServiceWorkerRegistration.h b/Source/modules/serviceworkers/ServiceWorkerRegistration.h |
index ee19ccc6bf62be7bd821d14b10a822252f831e9b..6e09dc96b9efad91c3b0d120e2a0673528ddb654 100644 |
--- a/Source/modules/serviceworkers/ServiceWorkerRegistration.h |
+++ b/Source/modules/serviceworkers/ServiceWorkerRegistration.h |
@@ -8,6 +8,7 @@ |
#include "core/dom/ActiveDOMObject.h" |
#include "core/events/EventTarget.h" |
#include "modules/serviceworkers/ServiceWorker.h" |
+#include "modules/serviceworkers/ServiceWorkerRegistration.h" |
#include "platform/Supplementable.h" |
#include "public/platform/WebServiceWorkerRegistration.h" |
#include "public/platform/WebServiceWorkerRegistrationProxy.h" |
@@ -83,6 +84,28 @@ private: |
bool m_stopped; |
}; |
+class ServiceWorkerRegistrationArray { |
+public: |
+ typedef WebVector<WebServiceWorkerRegistration*> WebType; |
+ static HeapVector<Member<ServiceWorkerRegistration>> take(ScriptPromiseResolver* resolver, WebType* webServiceWorkerRegistrationsRaw) |
+ { |
+ OwnPtr<WebType> webServiceWorkerRegistrations = adoptPtr(webServiceWorkerRegistrationsRaw); |
+ HeapVector<Member<ServiceWorkerRegistration>> registrations; |
+ for (size_t i = 0; i < webServiceWorkerRegistrations->size(); ++i) { |
+ registrations.append(ServiceWorkerRegistration::take(resolver, (*webServiceWorkerRegistrations)[i])); |
+ } |
+ return registrations; |
+ } |
+ static void dispose(WebType* webServiceWorkerRegistrationsRaw) |
+ { |
+ delete webServiceWorkerRegistrationsRaw; |
+ } |
+ |
+private: |
+ WTF_MAKE_NONCOPYABLE(ServiceWorkerRegistrationArray); |
+ ServiceWorkerRegistrationArray() = delete; |
+}; |
+ |
} // namespace blink |
#endif // ServiceWorkerRegistration_h |