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

Unified Diff: components/offline_pages/offline_page_model.h

Issue 2484223005: Store original request URL in offline page metadata table (Closed)
Patch Set: Add and update tests Created 4 years, 1 month 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: components/offline_pages/offline_page_model.h
diff --git a/components/offline_pages/offline_page_model.h b/components/offline_pages/offline_page_model.h
index 4222b53917dd5cfd5aa95916c6aea2a670b35d64..85f8685b1fb322efddfbb70e525505bf228284c3 100644
--- a/components/offline_pages/offline_page_model.h
+++ b/components/offline_pages/offline_page_model.h
@@ -47,6 +47,24 @@ struct OfflinePageItem;
// * how to cancel requests and what to expect
class OfflinePageModel : public base::SupportsUserData {
public:
+ // Describes the info about the page to save.
+ struct SavePageInfo {
fgorski 2016/11/10 23:56:13 How about renaming it to SavePageParams? Why? Beca
jianli 2016/11/16 01:25:40 Done.
+ SavePageInfo();
+
+ // The last committed URL of the page to save.
+ GURL url;
+
+ // The identification used by the client.
+ ClientId client_id;
+
+ // Used for the offline_id for the saved file if non-zero. If it is
+ // kInvalidOfflineId, a new, random ID will be generated.
+ int64_t proposed_offline_id;
+
+ // The original URL of the page to save. Empty if no redirect occurs.
+ GURL original_url;
+ };
+
// Observer of the OfflinePageModel.
class Observer {
public:
@@ -84,13 +102,9 @@ class OfflinePageModel : public base::SupportsUserData {
static const int64_t kInvalidOfflineId = 0;
// Attempts to save a page addressed by |url| offline. Requires that the model
fgorski 2016/11/10 23:56:13 url is not longer passed here.
jianli 2016/11/16 01:25:40 Done.
- // is loaded. Generates a new offline id and returns
- // it. |proposed_offline_id| is used for the offline_id for the saved file if
- // it is non-zero. If it is kInvalidOfflineId, a new, random ID will be
- // generated.
- virtual void SavePage(const GURL& url,
- const ClientId& client_id,
- int64_t proposed_offline_id,
+ // is loaded. Generates a new offline id or uses the proposed offline id and
+ // returns it.
+ virtual void SavePage(const SavePageInfo& save_page_info,
std::unique_ptr<OfflinePageArchiver> archiver,
const SavePageCallback& callback) = 0;

Powered by Google App Engine
This is Rietveld 408576698