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

Unified Diff: chromeos/network/portal_detector/network_portal_detector_strategy.h

Issue 419463004: Increased delay before next portal detection attempt in the case of !ONLINE -> ONLINE transition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
Index: chromeos/network/portal_detector/network_portal_detector_strategy.h
diff --git a/chromeos/network/portal_detector/network_portal_detector_strategy.h b/chromeos/network/portal_detector/network_portal_detector_strategy.h
index be0a6a7433f62ecc15db8f508fb46f57af90b50b..ad179971919894fec317f0f3130400a57d5d3088 100644
--- a/chromeos/network/portal_detector/network_portal_detector_strategy.h
+++ b/chromeos/network/portal_detector/network_portal_detector_strategy.h
@@ -15,7 +15,7 @@
namespace chromeos {
-class CHROMEOS_EXPORT PortalDetectorStrategy : protected net::BackoffEntry {
+class CHROMEOS_EXPORT PortalDetectorStrategy {
public:
enum StrategyId {
STRATEGY_ID_LOGIN_SCREEN,
@@ -40,9 +40,8 @@ class CHROMEOS_EXPORT PortalDetectorStrategy : protected net::BackoffEntry {
virtual ~PortalDetectorStrategy();
- static scoped_ptr<PortalDetectorStrategy> CreateById(StrategyId id);
-
- void set_delegate(Delegate* delegate) { delegate_ = delegate; }
+ static scoped_ptr<PortalDetectorStrategy> CreateById(StrategyId id,
+ Delegate* delegate);
// Returns delay before next detection attempt. This delay is needed
// to separate detection attempts in time.
@@ -56,21 +55,25 @@ class CHROMEOS_EXPORT PortalDetectorStrategy : protected net::BackoffEntry {
// Resets strategy to the initial state.
void Reset();
+ // Resets strategy to the initial stater and Sets initial delay
+ // before first attempt.
+ void SetInitialDelayAndReset(int initial_delay_ms);
+
// Should be called when portal detection is completed and timeout before next
// attempt should be adjusted.
void OnDetectionCompleted();
protected:
- PortalDetectorStrategy();
+ class BackoffEntryImpl;
- // net::BackoffEntry overrides:
- virtual base::TimeTicks ImplGetTimeNow() const OVERRIDE;
+ explicit PortalDetectorStrategy(Delegate* delegate);
// Interface for subclasses:
virtual base::TimeDelta GetNextAttemptTimeoutImpl();
Delegate* delegate_;
net::BackoffEntry::Policy policy_;
+ scoped_ptr<BackoffEntryImpl> backoff_entry_;
private:
friend class NetworkPortalDetectorImplTest;

Powered by Google App Engine
This is Rietveld 408576698