OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 #include "modules/background_fetch/BackgroundFetchedEvent.h" | 5 #include "modules/background_fetch/BackgroundFetchedEvent.h" |
6 | 6 |
7 #include "bindings/core/v8/ScriptPromiseResolver.h" | 7 #include "bindings/core/v8/ScriptPromiseResolver.h" |
8 #include "bindings/core/v8/ScriptState.h" | 8 #include "bindings/core/v8/ScriptState.h" |
9 #include "core/dom/DOMException.h" | 9 #include "core/dom/DOMException.h" |
10 #include "modules/EventModulesNames.h" | 10 #include "modules/EventModulesNames.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 m_fetches(initializer.fetches()) {} | 24 m_fetches(initializer.fetches()) {} |
25 | 25 |
26 BackgroundFetchedEvent::BackgroundFetchedEvent( | 26 BackgroundFetchedEvent::BackgroundFetchedEvent( |
27 const AtomicString& type, | 27 const AtomicString& type, |
28 const BackgroundFetchedEventInit& initializer, | 28 const BackgroundFetchedEventInit& initializer, |
29 const WebVector<WebBackgroundFetchSettledFetch>& fetches, | 29 const WebVector<WebBackgroundFetchSettledFetch>& fetches, |
30 ScriptState* scriptState, | 30 ScriptState* scriptState, |
31 WaitUntilObserver* observer, | 31 WaitUntilObserver* observer, |
32 ServiceWorkerRegistration* registration) | 32 ServiceWorkerRegistration* registration) |
33 : BackgroundFetchEvent(type, initializer, observer), | 33 : BackgroundFetchEvent(type, initializer, observer), |
34 m_fetches(initializer.fetches()), | |
35 m_registration(registration) { | 34 m_registration(registration) { |
36 m_fetches.reserveInitialCapacity(fetches.size()); | 35 m_fetches.reserveInitialCapacity(fetches.size()); |
37 for (const WebBackgroundFetchSettledFetch& fetch : fetches) { | 36 for (const WebBackgroundFetchSettledFetch& fetch : fetches) { |
38 auto* settledFetch = BackgroundFetchSettledFetch::create( | 37 auto* settledFetch = BackgroundFetchSettledFetch::create( |
39 Request::create(scriptState, fetch.request), | 38 Request::create(scriptState, fetch.request), |
40 Response::create(scriptState, fetch.response)); | 39 Response::create(scriptState, fetch.response)); |
41 | 40 |
42 m_fetches.push_back(settledFetch); | 41 m_fetches.push_back(settledFetch); |
43 } | 42 } |
44 } | 43 } |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 return EventNames::BackgroundFetchedEvent; | 89 return EventNames::BackgroundFetchedEvent; |
91 } | 90 } |
92 | 91 |
93 DEFINE_TRACE(BackgroundFetchedEvent) { | 92 DEFINE_TRACE(BackgroundFetchedEvent) { |
94 visitor->trace(m_fetches); | 93 visitor->trace(m_fetches); |
95 visitor->trace(m_registration); | 94 visitor->trace(m_registration); |
96 BackgroundFetchEvent::trace(visitor); | 95 BackgroundFetchEvent::trace(visitor); |
97 } | 96 } |
98 | 97 |
99 } // namespace blink | 98 } // namespace blink |
OLD | NEW |