| 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/ActiveScriptWrappable.h" | 8 #include "bindings/core/v8/ActiveScriptWrappable.h" |
| 9 #include "bindings/core/v8/ScriptPromiseResolver.h" | 9 #include "bindings/core/v8/ScriptPromiseResolver.h" |
| 10 #include "core/dom/ActiveDOMObject.h" | 10 #include "core/dom/ActiveDOMObject.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 | 73 |
| 74 // ActiveScriptWrappable overrides. | 74 // ActiveScriptWrappable overrides. |
| 75 bool hasPendingActivity() const final; | 75 bool hasPendingActivity() const final; |
| 76 | 76 |
| 77 // ActiveDOMObject overrides. | 77 // ActiveDOMObject overrides. |
| 78 void stop() override; | 78 void stop() override; |
| 79 | 79 |
| 80 // A handle to the registration representation in the embedder. | 80 // A handle to the registration representation in the embedder. |
| 81 OwnPtr<WebServiceWorkerRegistration::Handle> m_handle; | 81 OwnPtr<WebServiceWorkerRegistration::Handle> m_handle; |
| 82 | 82 |
| 83 WebServiceWorkerProvider* m_provider; | |
| 84 Member<ServiceWorker> m_installing; | 83 Member<ServiceWorker> m_installing; |
| 85 Member<ServiceWorker> m_waiting; | 84 Member<ServiceWorker> m_waiting; |
| 86 Member<ServiceWorker> m_active; | 85 Member<ServiceWorker> m_active; |
| 87 | 86 |
| 88 bool m_stopped; | 87 bool m_stopped; |
| 89 }; | 88 }; |
| 90 | 89 |
| 91 class ServiceWorkerRegistrationArray { | 90 class ServiceWorkerRegistrationArray { |
| 92 STATIC_ONLY(ServiceWorkerRegistrationArray); | 91 STATIC_ONLY(ServiceWorkerRegistrationArray); |
| 93 public: | 92 public: |
| 94 static HeapVector<Member<ServiceWorkerRegistration>> take(ScriptPromiseResol
ver* resolver, Vector<OwnPtr<WebServiceWorkerRegistration::Handle>>* webServiceW
orkerRegistrations) | 93 static HeapVector<Member<ServiceWorkerRegistration>> take(ScriptPromiseResol
ver* resolver, Vector<OwnPtr<WebServiceWorkerRegistration::Handle>>* webServiceW
orkerRegistrations) |
| 95 { | 94 { |
| 96 HeapVector<Member<ServiceWorkerRegistration>> registrations; | 95 HeapVector<Member<ServiceWorkerRegistration>> registrations; |
| 97 for (auto& registration : *webServiceWorkerRegistrations) | 96 for (auto& registration : *webServiceWorkerRegistrations) |
| 98 registrations.append(ServiceWorkerRegistration::getOrCreate(resolver
->getExecutionContext(), registration.release())); | 97 registrations.append(ServiceWorkerRegistration::getOrCreate(resolver
->getExecutionContext(), registration.release())); |
| 99 return registrations; | 98 return registrations; |
| 100 } | 99 } |
| 101 }; | 100 }; |
| 102 | 101 |
| 103 } // namespace blink | 102 } // namespace blink |
| 104 | 103 |
| 105 #endif // ServiceWorkerRegistration_h | 104 #endif // ServiceWorkerRegistration_h |
| OLD | NEW |