Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Side by Side Diff: third_party/WebKit/Source/modules/background_fetch/BackgroundFetchedEvent.cpp

Issue 2744873002: Implement the Request/Response bits of Background Fetch (Closed)
Patch Set: comments Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/BackgroundFetchedEventInit.h" 11 #include "modules/background_fetch/BackgroundFetchedEventInit.h"
11 12
12 namespace blink { 13 namespace blink {
13 14
14 BackgroundFetchedEvent::BackgroundFetchedEvent( 15 BackgroundFetchedEvent::BackgroundFetchedEvent(
15 const AtomicString& type, 16 const AtomicString& type,
16 const BackgroundFetchedEventInit& init) 17 const BackgroundFetchedEventInit& init)
17 : BackgroundFetchEvent(type, init) {} 18 : BackgroundFetchEvent(type, init),
19 m_completedFetches(init.completedFetches()) {}
18 20
19 BackgroundFetchedEvent::~BackgroundFetchedEvent() = default; 21 BackgroundFetchedEvent::~BackgroundFetchedEvent() = default;
20 22
23 HeapVector<Member<BackgroundFetchSettledRequest>>
24 BackgroundFetchedEvent::completedFetches() const {
25 return m_completedFetches;
26 }
27
21 ScriptPromise BackgroundFetchedEvent::updateUI(ScriptState* scriptState, 28 ScriptPromise BackgroundFetchedEvent::updateUI(ScriptState* scriptState,
22 String title) { 29 String title) {
23 return ScriptPromise::rejectWithDOMException( 30 return ScriptPromise::rejectWithDOMException(
24 scriptState, 31 scriptState,
25 DOMException::create(NotSupportedError, "Not implemented yet.")); 32 DOMException::create(NotSupportedError, "Not implemented yet."));
26 } 33 }
27 34
28 const AtomicString& BackgroundFetchedEvent::interfaceName() const { 35 const AtomicString& BackgroundFetchedEvent::interfaceName() const {
29 return EventNames::BackgroundFetchedEvent; 36 return EventNames::BackgroundFetchedEvent;
30 } 37 }
31 38
39 DEFINE_TRACE(BackgroundFetchedEvent) {
40 visitor->trace(m_completedFetches);
41 BackgroundFetchEvent::trace(visitor);
42 }
43
32 } // namespace blink 44 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698