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

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

Issue 385553002: BackoffEntry is used to compute timeouts between consecutive captive portal checks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 6 years, 5 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.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.h
diff --git a/chrome/browser/chromeos/net/network_portal_detector_impl.h b/chrome/browser/chromeos/net/network_portal_detector_impl.h
index f1cac1af30caa668d856d379206777e7017380fb..9fdedbecf293b7670c2ab4b53da2e4b440835618 100644
--- a/chrome/browser/chromeos/net/network_portal_detector_impl.h
+++ b/chrome/browser/chromeos/net/network_portal_detector_impl.h
@@ -82,7 +82,7 @@ class NetworkPortalDetectorImpl
virtual void DefaultNetworkChanged(const NetworkState* network) OVERRIDE;
// PortalDetectorStrategy::Delegate implementation:
- virtual int AttemptCount() OVERRIDE;
+ virtual int NoResponseResultCount() OVERRIDE;
virtual base::TimeTicks AttemptStartTime() OVERRIDE;
virtual base::TimeTicks GetCurrentTimeTicks() OVERRIDE;
@@ -126,12 +126,7 @@ class NetworkPortalDetectorImpl
// Stops whole detection process.
void StopDetection();
- // Internal predicate which describes set of states from which
- // DetectCaptivePortal() can be called.
- bool CanPerformAttempt() const;
-
// Initiates Captive Portal detection attempt after |delay|.
- // You should check CanPerformAttempt() before calling this method.
void ScheduleAttempt(const base::TimeDelta& delay);
// Starts detection attempt.
@@ -170,12 +165,16 @@ class NetworkPortalDetectorImpl
return state_ == STATE_CHECKING_FOR_PORTAL;
}
- int attempt_count_for_testing() {
- return attempt_count_;
+ int same_detection_result_count_for_testing() const {
+ return same_detection_result_count_;
+ }
+
+ int no_response_result_count_for_testing() const {
+ return no_response_result_count_;
}
- void set_attempt_count_for_testing(int attempt_count) {
- attempt_count_ = attempt_count;
+ void set_no_response_result_count_for_testing(int count) {
+ no_response_result_count_ = count;
}
// Returns delay before next portal check. Used by unit tests.
@@ -192,6 +191,10 @@ class NetworkPortalDetectorImpl
void RecordDetectionStats(const NetworkState* network,
CaptivePortalStatus status);
+ // Resets strategy and all counters used in computations of
+ // timeouts.
+ void ResetStrategyAndCounters();
+
// Sets current test time ticks. Used by unit tests.
void set_time_ticks_for_testing(const base::TimeTicks& time_ticks) {
time_ticks_for_testing_ = time_ticks;
@@ -233,15 +236,21 @@ class NetworkPortalDetectorImpl
// Start time of detection attempt.
base::TimeTicks attempt_start_time_;
- // Number of already performed detection attempts.
- int attempt_count_;
-
// Delay before next portal detection.
base::TimeDelta next_attempt_delay_;
// Current detection strategy.
scoped_ptr<PortalDetectorStrategy> strategy_;
+ // Last received result from captive portal detector.
+ CaptivePortalStatus last_detection_result_;
+
+ // Number of detection attempts with same result in a row.
+ int same_detection_result_count_;
+
+ // Number of detection attempts in a row with NO RESPONSE result.
+ int no_response_result_count_;
+
// UI notification controller about captive portal state.
NetworkPortalNotificationController notification_controller_;
« no previous file with comments | « no previous file | chrome/browser/chromeos/net/network_portal_detector_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698