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

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

Issue 1076853003: Refactor net::BackoffEntry to not require subclassing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address pneubeck's review comments Created 5 years, 8 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 ff6e890e97c6d620d591296e939ebb7490816562..3b8b5d3bd106c577ad6f23c0ce3edbf68679e18c 100644
--- a/chromeos/network/portal_detector/network_portal_detector_strategy.h
+++ b/chromeos/network/portal_detector/network_portal_detector_strategy.h
@@ -9,6 +9,7 @@
#include "base/compiler_specific.h"
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
+#include "base/time/tick_clock.h"
#include "base/time/time.h"
#include "chromeos/chromeos_export.h"
#include "net/base/backoff_entry.h"
@@ -23,9 +24,9 @@ class CHROMEOS_EXPORT PortalDetectorStrategy {
STRATEGY_ID_SESSION
};
- class Delegate {
+ class Delegate : public base::TickClock {
public:
- virtual ~Delegate() {}
+ ~Delegate() override;
// Returns number of attempts in a row with NO RESPONSE result.
// If last detection attempt has different result, returns 0.
@@ -33,13 +34,11 @@ class CHROMEOS_EXPORT PortalDetectorStrategy {
// Returns time when current attempt was started.
virtual base::TimeTicks AttemptStartTime() = 0;
-
- // Returns current TimeTicks.
- virtual base::TimeTicks GetCurrentTimeTicks() = 0;
};
virtual ~PortalDetectorStrategy();
+ // Lifetime of delegate must enclose lifetime of PortalDetectorStrategy.
static scoped_ptr<PortalDetectorStrategy> CreateById(StrategyId id,
Delegate* delegate);
@@ -65,8 +64,7 @@ class CHROMEOS_EXPORT PortalDetectorStrategy {
void OnDetectionCompleted();
protected:
- class BackoffEntryImpl;
-
+ // Lifetime of delegate must enclose lifetime of PortalDetectorStrategy.
explicit PortalDetectorStrategy(Delegate* delegate);
// Interface for subclasses:
@@ -74,7 +72,7 @@ class CHROMEOS_EXPORT PortalDetectorStrategy {
Delegate* delegate_;
net::BackoffEntry::Policy policy_;
- scoped_ptr<BackoffEntryImpl> backoff_entry_;
+ scoped_ptr<net::BackoffEntry> backoff_entry_;
private:
friend class NetworkPortalDetectorImplTest;

Powered by Google App Engine
This is Rietveld 408576698