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

Unified Diff: content/browser/background_fetch/background_fetch_request_info.h

Issue 2782553007: Implement the new polling system in the BackgroundFetchJobController (Closed)
Patch Set: Implement the new polling system in the BFJobController 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: content/browser/background_fetch/background_fetch_request_info.h
diff --git a/content/browser/background_fetch/background_fetch_request_info.h b/content/browser/background_fetch/background_fetch_request_info.h
index 914ca31da430d9c15ed211b105fffad19fca2011..5c99c0d4dd85616b31cc49c0dbde9e8913de2d9e 100644
--- a/content/browser/background_fetch/background_fetch_request_info.h
+++ b/content/browser/background_fetch/background_fetch_request_info.h
@@ -9,6 +9,7 @@
#include <vector>
#include "base/files/file_path.h"
+#include "content/browser/background_fetch/background_fetch_constants.h"
#include "content/common/content_export.h"
#include "content/common/service_worker/service_worker_types.h"
#include "content/public/browser/download_interrupt_reasons.h"
@@ -21,13 +22,17 @@ namespace content {
class CONTENT_EXPORT BackgroundFetchRequestInfo {
public:
BackgroundFetchRequestInfo();
- explicit BackgroundFetchRequestInfo(
- const ServiceWorkerFetchRequest& fetch_request);
+ BackgroundFetchRequestInfo(int request_index,
+ const ServiceWorkerFetchRequest& fetch_request);
// TODO(harkness): Remove copy constructor once the final (non-map-based)
// state management is in place.
BackgroundFetchRequestInfo(const BackgroundFetchRequestInfo& request);
~BackgroundFetchRequestInfo();
+ // Returns the index of this request in the larger Background Fetch fetch.
+ // Should only be consumed by the BackgroundFetchDataManager.
+ int request_index() const { return request_index_; }
+
const std::string& guid() const { return guid_; }
const GURL& GetURL() const;
@@ -58,6 +63,10 @@ class CONTENT_EXPORT BackgroundFetchRequestInfo {
bool IsComplete() const;
private:
+ // Index of this request within a Background Fetch registration.
+ int request_index_ = kInvalidBackgroundFetchRequestIndex;
+
+ // The request information provided by the developer.
ServiceWorkerFetchRequest fetch_request_;
std::string guid_;

Powered by Google App Engine
This is Rietveld 408576698