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 "bindings/core/v8/ScriptPromiseResolver.h" | 8 #include "bindings/core/v8/ScriptPromiseResolver.h" |
9 #include "core/dom/ActiveDOMObject.h" | 9 #include "core/dom/ActiveDOMObject.h" |
10 #include "core/events/EventTarget.h" | 10 #include "core/events/EventTarget.h" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 Member<ServiceWorker> m_installing; | 76 Member<ServiceWorker> m_installing; |
77 Member<ServiceWorker> m_waiting; | 77 Member<ServiceWorker> m_waiting; |
78 Member<ServiceWorker> m_active; | 78 Member<ServiceWorker> m_active; |
79 | 79 |
80 bool m_stopped; | 80 bool m_stopped; |
81 }; | 81 }; |
82 | 82 |
83 class ServiceWorkerRegistrationArray { | 83 class ServiceWorkerRegistrationArray { |
84 STATIC_ONLY(ServiceWorkerRegistrationArray); | 84 STATIC_ONLY(ServiceWorkerRegistrationArray); |
85 public: | 85 public: |
86 static HeapVector<Member<ServiceWorkerRegistration>> take(ScriptPromiseResol
ver* resolver, PassOwnPtr<WebVector<WebServiceWorkerRegistration*>> webServiceWo
rkerRegistrations) | 86 static HeapVector<Member<ServiceWorkerRegistration>> take(ScriptPromiseResol
ver* resolver, Vector<OwnPtr<WebServiceWorkerRegistration>>* webServiceWorkerReg
istrations) |
87 { | 87 { |
88 HeapVector<Member<ServiceWorkerRegistration>> registrations; | 88 HeapVector<Member<ServiceWorkerRegistration>> registrations; |
89 for (WebServiceWorkerRegistration* registration : *webServiceWorkerRegis
trations) | 89 for (auto& registration : *webServiceWorkerRegistrations) |
90 registrations.append(ServiceWorkerRegistration::create(resolver->exe
cutionContext(), adoptPtr(registration))); | 90 registrations.append(ServiceWorkerRegistration::create(resolver->exe
cutionContext(), registration.release())); |
91 return registrations; | 91 return registrations; |
92 } | 92 } |
93 }; | 93 }; |
94 | 94 |
95 } // namespace blink | 95 } // namespace blink |
96 | 96 |
97 #endif // ServiceWorkerRegistration_h | 97 #endif // ServiceWorkerRegistration_h |
OLD | NEW |