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

Unified Diff: chrome/browser/local_discovery/privet_url_fetcher.cc

Issue 69393003: Add minimum timeout for transient errors (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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
« no previous file with comments | « chrome/browser/local_discovery/privet_http_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/local_discovery/privet_url_fetcher.cc
diff --git a/chrome/browser/local_discovery/privet_url_fetcher.cc b/chrome/browser/local_discovery/privet_url_fetcher.cc
index f85a531f0d3065ed87307f12d1eed5e0d5e9db1f..671479db666eec41c2393194637f2af0989abe30 100644
--- a/chrome/browser/local_discovery/privet_url_fetcher.cc
+++ b/chrome/browser/local_discovery/privet_url_fetcher.cc
@@ -4,6 +4,8 @@
#include "chrome/browser/local_discovery/privet_url_fetcher.h"
+#include <algorithm>
+
#include "base/bind.h"
#include "base/json/json_reader.h"
#include "base/message_loop/message_loop.h"
@@ -156,6 +158,9 @@ void PrivetURLFetcher::ScheduleRetry(int timeout_seconds) {
int timeout_seconds_randomized =
static_cast<int>(timeout_seconds * random_scaling_factor);
+ timeout_seconds_randomized =
+ std::max(timeout_seconds_randomized, kPrivetMinimumTimeout);
+
base::MessageLoop::current()->PostDelayedTask(
FROM_HERE,
base::Bind(&PrivetURLFetcher::Try, weak_factory_.GetWeakPtr()),
« no previous file with comments | « chrome/browser/local_discovery/privet_http_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698