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

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

Issue 2751523008: Update Background Fetch IDLs following spec changes (Closed)
Patch Set: Update Background Fetch IDLs following spec changes 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 #ifndef BackgroundFetchedEvent_h 5 #ifndef BackgroundFetchedEvent_h
6 #define BackgroundFetchedEvent_h 6 #define BackgroundFetchedEvent_h
7 7
8 #include "bindings/core/v8/ScriptPromise.h" 8 #include "bindings/core/v8/ScriptPromise.h"
9 #include "modules/background_fetch/BackgroundFetchEvent.h" 9 #include "modules/background_fetch/BackgroundFetchEvent.h"
10 #include "platform/heap/Handle.h" 10 #include "platform/heap/Handle.h"
11 #include "public/platform/modules/background_fetch/background_fetch.mojom-blink. h" 11 #include "public/platform/modules/background_fetch/background_fetch.mojom-blink. h"
12 #include "wtf/text/AtomicString.h" 12 #include "wtf/text/AtomicString.h"
13 13
14 namespace blink { 14 namespace blink {
15 15
16 class BackgroundFetchSettledRequest; 16 class BackgroundFetchSettledFetch;
17 class BackgroundFetchedEventInit; 17 class BackgroundFetchedEventInit;
18 class ServiceWorkerRegistration; 18 class ServiceWorkerRegistration;
19 19
20 class BackgroundFetchedEvent final : public BackgroundFetchEvent { 20 class BackgroundFetchedEvent final : public BackgroundFetchEvent {
21 DEFINE_WRAPPERTYPEINFO(); 21 DEFINE_WRAPPERTYPEINFO();
22 22
23 public: 23 public:
24 static BackgroundFetchedEvent* create( 24 static BackgroundFetchedEvent* create(
25 const AtomicString& type, 25 const AtomicString& type,
26 const BackgroundFetchedEventInit& initializer) { 26 const BackgroundFetchedEventInit& initializer) {
27 return new BackgroundFetchedEvent(type, initializer, 27 return new BackgroundFetchedEvent(type, initializer,
28 nullptr /* registration */); 28 nullptr /* registration */);
29 } 29 }
30 30
31 static BackgroundFetchedEvent* create( 31 static BackgroundFetchedEvent* create(
32 const AtomicString& type, 32 const AtomicString& type,
33 const BackgroundFetchedEventInit& initializer, 33 const BackgroundFetchedEventInit& initializer,
34 ServiceWorkerRegistration* registration) { 34 ServiceWorkerRegistration* registration) {
35 return new BackgroundFetchedEvent(type, initializer, registration); 35 return new BackgroundFetchedEvent(type, initializer, registration);
36 } 36 }
37 37
38 ~BackgroundFetchedEvent() override; 38 ~BackgroundFetchedEvent() override;
39 39
40 // Web Exposed attribute defined in the IDL file. 40 // Web Exposed attribute defined in the IDL file.
41 HeapVector<Member<BackgroundFetchSettledRequest>> completedFetches() const; 41 HeapVector<Member<BackgroundFetchSettledFetch>> fetches() const;
42 42
43 // Web Exposed method defined in the IDL file. 43 // Web Exposed method defined in the IDL file.
44 ScriptPromise updateUI(ScriptState*, const String& title); 44 ScriptPromise updateUI(ScriptState*, const String& title);
45 45
46 // ExtendableEvent interface. 46 // ExtendableEvent interface.
47 const AtomicString& interfaceName() const override; 47 const AtomicString& interfaceName() const override;
48 48
49 DECLARE_VIRTUAL_TRACE(); 49 DECLARE_VIRTUAL_TRACE();
50 50
51 private: 51 private:
52 BackgroundFetchedEvent(const AtomicString& type, 52 BackgroundFetchedEvent(const AtomicString& type,
53 const BackgroundFetchedEventInit&, 53 const BackgroundFetchedEventInit&,
54 ServiceWorkerRegistration*); 54 ServiceWorkerRegistration*);
55 55
56 void didUpdateUI(ScriptPromiseResolver*, mojom::blink::BackgroundFetchError); 56 void didUpdateUI(ScriptPromiseResolver*, mojom::blink::BackgroundFetchError);
57 57
58 HeapVector<Member<BackgroundFetchSettledRequest>> m_completedFetches; 58 HeapVector<Member<BackgroundFetchSettledFetch>> m_fetches;
59 Member<ServiceWorkerRegistration> m_registration; 59 Member<ServiceWorkerRegistration> m_registration;
60 }; 60 };
61 61
62 } // namespace blink 62 } // namespace blink
63 63
64 #endif // BackgroundFetchedEvent_h 64 #endif // BackgroundFetchedEvent_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698