| 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/ScriptState.h" | 7 #include "bindings/core/v8/ScriptState.h" |
| 8 #include "core/dom/DOMException.h" | 8 #include "core/dom/DOMException.h" |
| 9 #include "modules/EventModulesNames.h" | 9 #include "modules/EventModulesNames.h" |
| 10 #include "modules/background_fetch/BackgroundFetchSettledRequest.h" | 10 #include "modules/background_fetch/BackgroundFetchSettledRequest.h" |
| 11 #include "modules/background_fetch/BackgroundFetchedEventInit.h" | 11 #include "modules/background_fetch/BackgroundFetchedEventInit.h" |
| 12 | 12 |
| 13 namespace blink { | 13 namespace blink { |
| 14 | 14 |
| 15 BackgroundFetchedEvent::BackgroundFetchedEvent( | 15 BackgroundFetchedEvent::BackgroundFetchedEvent( |
| 16 const AtomicString& type, | 16 const AtomicString& type, |
| 17 const BackgroundFetchedEventInit& init) | 17 const BackgroundFetchedEventInit& init) |
| 18 : BackgroundFetchEvent(type, init), | 18 : BackgroundFetchEvent(type, init, nullptr /* observer */), |
| 19 m_completedFetches(init.completedFetches()) {} | 19 m_completedFetches(init.completedFetches()) {} |
| 20 | 20 |
| 21 BackgroundFetchedEvent::~BackgroundFetchedEvent() = default; | 21 BackgroundFetchedEvent::~BackgroundFetchedEvent() = default; |
| 22 | 22 |
| 23 HeapVector<Member<BackgroundFetchSettledRequest>> | 23 HeapVector<Member<BackgroundFetchSettledRequest>> |
| 24 BackgroundFetchedEvent::completedFetches() const { | 24 BackgroundFetchedEvent::completedFetches() const { |
| 25 return m_completedFetches; | 25 return m_completedFetches; |
| 26 } | 26 } |
| 27 | 27 |
| 28 ScriptPromise BackgroundFetchedEvent::updateUI(ScriptState* scriptState, | 28 ScriptPromise BackgroundFetchedEvent::updateUI(ScriptState* scriptState, |
| 29 String title) { | 29 String title) { |
| 30 return ScriptPromise::rejectWithDOMException( | 30 return ScriptPromise::rejectWithDOMException( |
| 31 scriptState, | 31 scriptState, |
| 32 DOMException::create(NotSupportedError, "Not implemented yet.")); | 32 DOMException::create(NotSupportedError, "Not implemented yet.")); |
| 33 } | 33 } |
| 34 | 34 |
| 35 const AtomicString& BackgroundFetchedEvent::interfaceName() const { | 35 const AtomicString& BackgroundFetchedEvent::interfaceName() const { |
| 36 return EventNames::BackgroundFetchedEvent; | 36 return EventNames::BackgroundFetchedEvent; |
| 37 } | 37 } |
| 38 | 38 |
| 39 DEFINE_TRACE(BackgroundFetchedEvent) { | 39 DEFINE_TRACE(BackgroundFetchedEvent) { |
| 40 visitor->trace(m_completedFetches); | 40 visitor->trace(m_completedFetches); |
| 41 BackgroundFetchEvent::trace(visitor); | 41 BackgroundFetchEvent::trace(visitor); |
| 42 } | 42 } |
| 43 | 43 |
| 44 } // namespace blink | 44 } // namespace blink |
| OLD | NEW |