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

Unified Diff: components/ntp_snippets/ntp_snippets_fetcher.cc

Issue 1789513003: Downloading the json file from ChromeReader is tried several times when ERR_NETW… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fetcher-sign-in
Patch Set: Created 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/ntp_snippets/ntp_snippets_fetcher.cc
diff --git a/components/ntp_snippets/ntp_snippets_fetcher.cc b/components/ntp_snippets/ntp_snippets_fetcher.cc
index df384ddb1cca19bcd708263430ec8e1a24a0aab1..4b136b29deb699c40b5c8f802d308229635501d9 100644
--- a/components/ntp_snippets/ntp_snippets_fetcher.cc
+++ b/components/ntp_snippets/ntp_snippets_fetcher.cc
@@ -70,6 +70,14 @@ void NTPSnippetsFetcher::FetchSnippets() {
url_fetcher_->SetUploadData("application/json",
kUnpersonalizedRequestParameters);
url_fetcher_->SaveResponseToTemporaryFile(file_task_runner_.get());
+
+ // Fetchers are sometimes cancelled because a network change was detected,
+ // especially at startup and after sign-in on ChromeOS. Retrying once should
Marc Treib 2016/03/23 11:50:08 I would remove everything after the first line her
jkrcal 2016/03/23 21:10:28 Done.
+ // be enough in those cases; let the fetcher retry up to 3 times just in case.
+ // http://crbug.com/163710
+ url_fetcher_->SetAutomaticallyRetryOnNetworkChanges(3);
+ // Enable fetching the files properly even with poor connection
Marc Treib 2016/03/23 11:50:08 This is IMO a bit too generic - it's more "try to
jkrcal 2016/03/23 21:10:28 Done.
+ url_fetcher_->SetMaxRetriesOn5xx(3);
url_fetcher_->Start();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698