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

Unified Diff: components/offline_pages/core/background/request_coordinator.h

Issue 2713013002: Track original URL when downloading a redirected page (Closed)
Patch Set: A little update Created 3 years, 10 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: components/offline_pages/core/background/request_coordinator.h
diff --git a/components/offline_pages/core/background/request_coordinator.h b/components/offline_pages/core/background/request_coordinator.h
index 09606f2e71bf67e3e28f69c0b188179ebc571ef3..13907ccc9fe7391e61b12c92ee8b53d280586189 100644
--- a/components/offline_pages/core/background/request_coordinator.h
+++ b/components/offline_pages/core/background/request_coordinator.h
@@ -60,6 +60,28 @@ class RequestCoordinator : public KeyedService,
DISABLED_FOR_OFFLINER,
};
+ // Describes the parameters to control how to save a page when system
+ // conditions allow.
+ struct SavePageLaterParams {
+ SavePageLaterParams();
+ SavePageLaterParams(const SavePageLaterParams& other);
+
+ // The last committed URL of the page to save.
+ GURL url;
+
+ // The identification used by the client.
+ ClientId client_id;
+
+ // Whether the user requests the save action.
+ bool user_requested;
fgorski 2017/02/27 17:34:36 document the default (if you wish to use it in cod
jianli 2017/02/27 23:20:07 Done.
+
+ // Request availability.
fgorski 2017/02/27 17:34:36 if we want to roll with the default, lets document
jianli 2017/02/27 23:20:07 Done.
+ RequestAvailability availability;
+
+ // The original URL of the page to save. Empty if no redirect occurs.
+ GURL original_url;
+ };
+
// Callback specifying which request IDs were actually removed.
typedef base::Callback<void(const MultipleItemStatuses&)>
RemoveRequestsCallback;
@@ -79,10 +101,7 @@ class RequestCoordinator : public KeyedService,
// Queues |request| to later load and save when system conditions allow.
// Returns an id if the page could be queued successfully, 0L otherwise.
- int64_t SavePageLater(const GURL& url,
- const ClientId& client_id,
- bool user_requested,
- RequestAvailability availability);
+ int64_t SavePageLater(const SavePageLaterParams& save_page_later_params);
// Remove a list of requests by |request_id|. This removes requests from the
// request queue, and cancels an in-progress prerender.

Powered by Google App Engine
This is Rietveld 408576698