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

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

Issue 2806713002: Some minor fixes for Background Fetch (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « content/browser/storage_partition_impl_map.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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
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
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
OLDNEW
« no previous file with comments | « content/browser/storage_partition_impl_map.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698