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

Unified Diff: third_party/WebKit/Source/modules/background_fetch/BackgroundFetchManager.h

Issue 2762243002: Convert Background Fetch' input to a WebServiceWorkerRequest vector (Closed)
Patch Set: IWYU 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/BackgroundFetchManager.h
diff --git a/third_party/WebKit/Source/modules/background_fetch/BackgroundFetchManager.h b/third_party/WebKit/Source/modules/background_fetch/BackgroundFetchManager.h
index b524fd55a6399094b46e46222b27778e93a29537..ad1c4f4f6f028013f71d151ca56ec448fc01769f 100644
--- a/third_party/WebKit/Source/modules/background_fetch/BackgroundFetchManager.h
+++ b/third_party/WebKit/Source/modules/background_fetch/BackgroundFetchManager.h
@@ -7,6 +7,7 @@
#include "bindings/core/v8/ScriptPromise.h"
#include "bindings/core/v8/ScriptWrappable.h"
+#include "modules/ModulesExport.h"
#include "platform/heap/GarbageCollected.h"
#include "platform/heap/Handle.h"
#include "public/platform/modules/background_fetch/background_fetch.mojom-blink.h"
@@ -16,14 +17,16 @@ namespace blink {
class BackgroundFetchBridge;
class BackgroundFetchOptions;
class BackgroundFetchRegistration;
+class ExceptionState;
class RequestOrUSVStringOrRequestOrUSVStringSequence;
class ScriptPromiseResolver;
class ScriptState;
class ServiceWorkerRegistration;
+class WebServiceWorkerRequest;
// Implementation of the BackgroundFetchManager JavaScript object, accessible
// by developers through ServiceWorkerRegistration.backgroundFetch.
-class BackgroundFetchManager final
+class MODULES_EXPORT BackgroundFetchManager final
: public GarbageCollected<BackgroundFetchManager>,
public ScriptWrappable {
DEFINE_WRAPPERTYPEINFO();
@@ -39,15 +42,25 @@ class BackgroundFetchManager final
ScriptState*,
const String& tag,
const RequestOrUSVStringOrRequestOrUSVStringSequence& requests,
- const BackgroundFetchOptions&);
+ const BackgroundFetchOptions&,
+ ExceptionState&);
ScriptPromise get(ScriptState*, const String& tag);
ScriptPromise getTags(ScriptState*);
DECLARE_TRACE();
private:
+ friend class BackgroundFetchManagerTest;
+
explicit BackgroundFetchManager(ServiceWorkerRegistration*);
+ // Creates a vector of WebServiceWorkerRequest objects for the given set of
+ // |requests|, which can be either Request objects or URL strings.
+ static Vector<WebServiceWorkerRequest> createWebRequestVector(
+ ScriptState*,
+ const RequestOrUSVStringOrRequestOrUSVStringSequence& requests,
+ ExceptionState&);
+
void didFetch(ScriptPromiseResolver*,
mojom::blink::BackgroundFetchError,
BackgroundFetchRegistration*);

Powered by Google App Engine
This is Rietveld 408576698