| 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/ContextLifecycleObserver.h" | 10 #include "core/dom/ContextLifecycleObserver.h" |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 | 109 |
| 110 public: | 110 public: |
| 111 // Called from CallbackPromiseAdapter. | 111 // Called from CallbackPromiseAdapter. |
| 112 using WebType = std::unique_ptr< | 112 using WebType = std::unique_ptr< |
| 113 WebVector<std::unique_ptr<WebServiceWorkerRegistration::Handle>>>; | 113 WebVector<std::unique_ptr<WebServiceWorkerRegistration::Handle>>>; |
| 114 static HeapVector<Member<ServiceWorkerRegistration>> take( | 114 static HeapVector<Member<ServiceWorkerRegistration>> take( |
| 115 ScriptPromiseResolver* resolver, | 115 ScriptPromiseResolver* resolver, |
| 116 WebType webServiceWorkerRegistrations) { | 116 WebType webServiceWorkerRegistrations) { |
| 117 HeapVector<Member<ServiceWorkerRegistration>> registrations; | 117 HeapVector<Member<ServiceWorkerRegistration>> registrations; |
| 118 for (auto& registration : *webServiceWorkerRegistrations) { | 118 for (auto& registration : *webServiceWorkerRegistrations) { |
| 119 registrations.append( | 119 registrations.push_back( |
| 120 ServiceWorkerRegistration::take(resolver, std::move(registration))); | 120 ServiceWorkerRegistration::take(resolver, std::move(registration))); |
| 121 } | 121 } |
| 122 return registrations; | 122 return registrations; |
| 123 } | 123 } |
| 124 }; | 124 }; |
| 125 | 125 |
| 126 } // namespace blink | 126 } // namespace blink |
| 127 | 127 |
| 128 #endif // ServiceWorkerRegistration_h | 128 #endif // ServiceWorkerRegistration_h |
| OLD | NEW |