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

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: add response_code 200 check and modify tests 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..a256f2f6e1994502d44163c3fe73c1bf20d2ead6 100644
--- a/chrome/browser/chromeos/net/network_portal_detector_impl.cc
+++ b/chrome/browser/chromeos/net/network_portal_detector_impl.cc
@@ -550,9 +550,14 @@ void NetworkPortalDetectorImpl::OnAttemptCompleted(
OnDetectionCompleted(network, state);
}
- // Observers (via OnDetectionCompleted) may already schedule new attempt.
- if (is_idle())
+ // Do not schedule attempt if (1) Observers (via OnDetectionCompleted) has
+ // already scheduled a new attempt or (2) we are behind a captive portal with
+ // response code 200, which can be either the result of NetworkPortalDetector
+ // or shill's detection.
+ if (is_idle() &&
+ (state.status != CAPTIVE_PORTAL_STATUS_PORTAL || response_code != 200)) {
ScheduleAttempt(results.retry_after_delta);
+ }
stevenjb 2017/03/17 16:53:01 This logic got a bit complicated, let's break it u
Qiang(Joe) Xu 2017/03/17 17:23:55 agree. Done, thanks!
}
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