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

Unified Diff: chrome/browser/android/offline_pages/background_loader_offliner.cc

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: chrome/browser/android/offline_pages/background_loader_offliner.cc
diff --git a/chrome/browser/android/offline_pages/background_loader_offliner.cc b/chrome/browser/android/offline_pages/background_loader_offliner.cc
index 732a4eca3a09ec77bba2bbc4366e30faed6f2413..59a9ff18a0aaf3e46384c5da0bc9877907b33526 100644
--- a/chrome/browser/android/offline_pages/background_loader_offliner.cc
+++ b/chrome/browser/android/offline_pages/background_loader_offliner.cc
@@ -153,6 +153,14 @@ void BackgroundLoaderOffliner::DidStopLoading() {
params.client_id = request.client_id();
params.proposed_offline_id = request.request_id();
params.is_background = true;
+
+ // Pass in the original URL if it is different from the last committed URL
+ // when redirects occur.
fgorski 2017/02/27 17:34:35 please sync. I think Cathy was making a similar ch
jianli 2017/02/27 23:20:06 Synced. Cathy ported my previous original URL chan
+ if (!request.original_url().is_empty())
+ params.original_url = request.original_url();
+ else if (params.url != request.url())
+ params.original_url = request.url();
+
offline_page_model_->SavePage(
params, std::move(archiver),
base::Bind(&BackgroundLoaderOffliner::OnPageSaved,

Powered by Google App Engine
This is Rietveld 408576698