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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/background_fetch/BackgroundFetchedEvent.h
diff --git a/third_party/WebKit/Source/modules/background_fetch/BackgroundFetchedEvent.h b/third_party/WebKit/Source/modules/background_fetch/BackgroundFetchedEvent.h
index aaee6f61e9be01c065e1e04aef395195df48a002..1e635949468c8426f64dd5331ccc8b7c9532a618 100644
--- a/third_party/WebKit/Source/modules/background_fetch/BackgroundFetchedEvent.h
+++ b/third_party/WebKit/Source/modules/background_fetch/BackgroundFetchedEvent.h
@@ -8,12 +8,14 @@
#include "bindings/core/v8/ScriptPromise.h"
#include "modules/background_fetch/BackgroundFetchEvent.h"
#include "platform/heap/Handle.h"
+#include "public/platform/modules/background_fetch/background_fetch.mojom-blink.h"
#include "wtf/text/AtomicString.h"
namespace blink {
class BackgroundFetchSettledRequest;
class BackgroundFetchedEventInit;
+class ServiceWorkerRegistration;
class BackgroundFetchedEvent final : public BackgroundFetchEvent {
DEFINE_WRAPPERTYPEINFO();
@@ -22,7 +24,15 @@ class BackgroundFetchedEvent final : public BackgroundFetchEvent {
static BackgroundFetchedEvent* create(
const AtomicString& type,
const BackgroundFetchedEventInit& initializer) {
- return new BackgroundFetchedEvent(type, initializer);
+ return new BackgroundFetchedEvent(type, initializer,
+ nullptr /* registration */);
+ }
+
+ static BackgroundFetchedEvent* create(
+ const AtomicString& type,
+ const BackgroundFetchedEventInit& initializer,
+ ServiceWorkerRegistration* registration) {
+ return new BackgroundFetchedEvent(type, initializer, registration);
}
~BackgroundFetchedEvent() override;
@@ -31,7 +41,7 @@ class BackgroundFetchedEvent final : public BackgroundFetchEvent {
HeapVector<Member<BackgroundFetchSettledRequest>> completedFetches() const;
// Web Exposed method defined in the IDL file.
- ScriptPromise updateUI(ScriptState*, String title);
+ ScriptPromise updateUI(ScriptState*, const String& title);
// ExtendableEvent interface.
const AtomicString& interfaceName() const override;
@@ -40,9 +50,13 @@ class BackgroundFetchedEvent final : public BackgroundFetchEvent {
private:
BackgroundFetchedEvent(const AtomicString& type,
- const BackgroundFetchedEventInit&);
+ const BackgroundFetchedEventInit&,
+ ServiceWorkerRegistration*);
+
+ void didUpdateUI(ScriptPromiseResolver*, mojom::blink::BackgroundFetchError);
HeapVector<Member<BackgroundFetchSettledRequest>> m_completedFetches;
+ Member<ServiceWorkerRegistration> m_registration;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698