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

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

Issue 2767373002: Implement GetJobResponse and merge JobData into DataManager. (Closed)
Patch Set: Removed typedef and added DISALLOW_COPY_AND_ASSIGN 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 d7e4582a751d6748cb05c3b2b229b2d5cb480495..57b76beed2902fe22508826499e9e3bfe21488f0 100644
--- a/content/browser/background_fetch/background_fetch_request_info.h
+++ b/content/browser/background_fetch/background_fetch_request_info.h
@@ -5,8 +5,10 @@
#ifndef CONTENT_BROWSER_BACKGROUND_FETCH_REQUEST_INFO_H_
#define CONTENT_BROWSER_BACKGROUND_FETCH_REQUEST_INFO_H_
+#include <memory>
#include <vector>
+#include "base/files/file_path.h"
#include "content/common/content_export.h"
#include "content/public/browser/download_interrupt_reasons.h"
#include "content/public/browser/download_item.h"
@@ -41,19 +43,34 @@ class CONTENT_EXPORT BackgroundFetchRequestInfo {
interrupt_reason_ = reason;
}
+ const base::FilePath& file_path() const { return file_path_; }
+ void set_file_path(const base::FilePath& file_path) {
+ file_path_ = file_path;
+ }
+
+ int64_t received_bytes() const { return received_bytes_; }
+ void set_received_bytes(int64_t received_bytes) {
+ received_bytes_ = received_bytes;
+ }
+
+ bool IsComplete() const;
+
private:
std::string guid_;
GURL url_;
std::string tag_;
std::string download_guid_;
+
+ // The following members do not need to be persisted, they can be reset after
+ // a chrome restart.
DownloadItem::DownloadState state_ =
DownloadItem::DownloadState::MAX_DOWNLOAD_STATE;
DownloadInterruptReason interrupt_reason_ =
DownloadInterruptReason::DOWNLOAD_INTERRUPT_REASON_NONE;
+ base::FilePath file_path_;
+ int64_t received_bytes_ = 0;
};
-using BackgroundFetchRequestInfos = std::vector<BackgroundFetchRequestInfo>;
-
} // namespace content
#endif // CONTENT_BROWSER_BACKGROUND_FETCH_REQUEST_INFO_H_

Powered by Google App Engine
This is Rietveld 408576698