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

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

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

Powered by Google App Engine
This is Rietveld 408576698