| Index: chrome/browser/captive_portal/captive_portal_service.h
|
| diff --git a/chrome/browser/captive_portal/captive_portal_service.h b/chrome/browser/captive_portal/captive_portal_service.h
|
| index c48ca5d37c1bf40459f6e60051f1a9d88621dfc8..f239c61e1c04f80bf1e0a15c570807d0405f9a97 100644
|
| --- a/chrome/browser/captive_portal/captive_portal_service.h
|
| +++ b/chrome/browser/captive_portal/captive_portal_service.h
|
| @@ -9,6 +9,7 @@
|
| #include "base/memory/scoped_ptr.h"
|
| #include "base/prefs/pref_member.h"
|
| #include "base/threading/non_thread_safe.h"
|
| +#include "base/time/tick_clock.h"
|
| #include "base/time/time.h"
|
| #include "base/timer/timer.h"
|
| #include "components/captive_portal/captive_portal_detector.h"
|
| @@ -25,7 +26,8 @@ class Profile;
|
| // Captive portal checks are rate-limited. The CaptivePortalService may only
|
| // be accessed on the UI thread.
|
| // Design doc: https://docs.google.com/document/d/1k-gP2sswzYNvryu9NcgN7q5XrsMlUdlUdoW9WRaEmfM/edit
|
| -class CaptivePortalService : public KeyedService, public base::NonThreadSafe {
|
| +class CaptivePortalService : public KeyedService, public base::NonThreadSafe,
|
| + private base::TickClock {
|
| public:
|
| enum TestingState {
|
| NOT_TESTING,
|
| @@ -79,9 +81,9 @@ class CaptivePortalService : public KeyedService, public base::NonThreadSafe {
|
| friend class CaptivePortalServiceTest;
|
| friend class CaptivePortalBrowserTest;
|
|
|
| - // Subclass of BackoffEntry that uses the CaptivePortalService's
|
| - // GetCurrentTime function, for unit testing.
|
| - class RecheckBackoffEntry;
|
| + // Subclass of TickClock that uses the CaptivePortalService's
|
| + // GetCurrentTimeTicks function, for unit testing.
|
| + class RecheckTickClock;
|
|
|
| enum State {
|
| // No check is running or pending.
|
| @@ -138,8 +140,8 @@ class CaptivePortalService : public KeyedService, public base::NonThreadSafe {
|
| // Android, since it lacks the Browser class.
|
| void UpdateEnabledState();
|
|
|
| - // Returns the current TimeTicks.
|
| - base::TimeTicks GetCurrentTimeTicks() const;
|
| + // base::TickClock implementation.
|
| + base::TimeTicks NowTicks() override;
|
|
|
| bool DetectionInProgress() const;
|
|
|
|
|