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

Unified Diff: chrome/browser/chromeos/net/network_portal_detector_impl.cc

Issue 2756643002: cros: Do not schedule attempt when behind captive portal with response 200 is detected (Closed)
Patch Set: feedback Created 3 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 | chrome/browser/chromeos/net/network_portal_detector_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/net/network_portal_detector_impl.cc
diff --git a/chrome/browser/chromeos/net/network_portal_detector_impl.cc b/chrome/browser/chromeos/net/network_portal_detector_impl.cc
index b4691cdd4f7e92e6ed87b1cbacbae275e4599dad..c3886f6f12393d37ace785460527f4e095f2f215 100644
--- a/chrome/browser/chromeos/net/network_portal_detector_impl.cc
+++ b/chrome/browser/chromeos/net/network_portal_detector_impl.cc
@@ -551,8 +551,15 @@ void NetworkPortalDetectorImpl::OnAttemptCompleted(
}
// Observers (via OnDetectionCompleted) may already schedule new attempt.
- if (is_idle())
- ScheduleAttempt(results.retry_after_delta);
+ if (!is_idle())
+ return;
+
+ // If behind a captive portal and the response code was 200 (OK), do not
+ // schedule a new attempt.
+ if (state.status == CAPTIVE_PORTAL_STATUS_PORTAL && response_code == 200)
+ return;
+
+ ScheduleAttempt(results.retry_after_delta);
}
void NetworkPortalDetectorImpl::Observe(
« no previous file with comments | « no previous file | chrome/browser/chromeos/net/network_portal_detector_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698