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

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

Issue 2744873002: Implement the Request/Response bits of Background Fetch (Closed)
Patch Set: comments 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/BackgroundFetchSettledRequest.h
diff --git a/third_party/WebKit/Source/modules/background_fetch/BackgroundFetchSettledRequest.h b/third_party/WebKit/Source/modules/background_fetch/BackgroundFetchSettledRequest.h
new file mode 100644
index 0000000000000000000000000000000000000000..0761c5589120b55c419be6b18a98869a29c10478
--- /dev/null
+++ b/third_party/WebKit/Source/modules/background_fetch/BackgroundFetchSettledRequest.h
@@ -0,0 +1,41 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BackgroundFetchSettledRequest_h
+#define BackgroundFetchSettledRequest_h
+
+#include "modules/background_fetch/BackgroundFetchRequest.h"
+#include "platform/heap/Handle.h"
+
+namespace blink {
+
+class Request;
+class Response;
+
+// Interface for providing developers access to the Request/Response pairs when
+// a background fetch has settled, either through the `backgroundfetched` event
+// in case of success, or `backgroundfetchfail` in case of failure.
+class BackgroundFetchSettledRequest final : public BackgroundFetchRequest {
+ DEFINE_WRAPPERTYPEINFO();
+
+ public:
+ static BackgroundFetchSettledRequest* create(Request* request,
+ Response* response) {
+ return new BackgroundFetchSettledRequest(request, response);
+ }
+
+ // Web Exposed attribute defined in the IDL file.
+ Response* response() const;
+
+ DECLARE_VIRTUAL_TRACE();
+
+ private:
+ BackgroundFetchSettledRequest(Request*, Response*);
+
+ Member<Response> m_response;
+};
+
+} // namespace blink
+
+#endif // BackgroundFetchSettledRequest_h

Powered by Google App Engine
This is Rietveld 408576698