OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef COMPONENTS_PROXIMITY_AUTH_CRYPTAUTH_CRYPTAUTH_SYNC_SCHEDULER_IMPL_H | 5 #ifndef COMPONENTS_PROXIMITY_AUTH_CRYPTAUTH_CRYPTAUTH_SYNC_SCHEDULER_IMPL_H |
6 #define COMPONENTS_PROXIMITY_AUTH_CRYPTAUTH_CRYPTAUTH_SYNC_SCHEDULER_IMPL_H | 6 #define COMPONENTS_PROXIMITY_AUTH_CRYPTAUTH_CRYPTAUTH_SYNC_SCHEDULER_IMPL_H |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "base/timer/timer.h" | 11 #include "base/timer/timer.h" |
12 #include "components/proximity_auth/cryptauth/sync_scheduler.h" | 12 #include "components/cryptauth/sync_scheduler.h" |
13 | 13 |
14 namespace proximity_auth { | 14 namespace cryptauth { |
15 | 15 |
16 // Implementation of SyncScheduler. | 16 // Implementation of SyncScheduler. |
17 class SyncSchedulerImpl : public SyncScheduler { | 17 class SyncSchedulerImpl : public SyncScheduler { |
18 public: | 18 public: |
19 // Creates the scheduler: | 19 // Creates the scheduler: |
20 // |delegate|: Handles sync requests and must outlive the scheduler. | 20 // |delegate|: Handles sync requests and must outlive the scheduler. |
21 // |refresh_period|: The time to wait for the PERIODIC_REFRESH strategy. | 21 // |refresh_period|: The time to wait for the PERIODIC_REFRESH strategy. |
22 // |base_recovery_period|: The initial time to wait for the | 22 // |base_recovery_period|: The initial time to wait for the |
23 // AGGRESSIVE_RECOVERY strategy. The time delta is increased for each | 23 // AGGRESSIVE_RECOVERY strategy. The time delta is increased for each |
24 // subsequent failure. | 24 // subsequent failure. |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 size_t failure_count_; | 92 size_t failure_count_; |
93 | 93 |
94 // Timer firing for the next sync request. | 94 // Timer firing for the next sync request. |
95 std::unique_ptr<base::Timer> timer_; | 95 std::unique_ptr<base::Timer> timer_; |
96 | 96 |
97 base::WeakPtrFactory<SyncSchedulerImpl> weak_ptr_factory_; | 97 base::WeakPtrFactory<SyncSchedulerImpl> weak_ptr_factory_; |
98 | 98 |
99 DISALLOW_COPY_AND_ASSIGN(SyncSchedulerImpl); | 99 DISALLOW_COPY_AND_ASSIGN(SyncSchedulerImpl); |
100 }; | 100 }; |
101 | 101 |
102 } // namespace proximity_auth | 102 } // namespace cryptauth |
103 | 103 |
104 #endif // COMPONENTS_PROXIMITY_CRYPTAUTH_CRYPTAUTH_SYNC_SCHEDULER_IMPL_H | 104 #endif // COMPONENTS_PROXIMITY_CRYPTAUTH_CRYPTAUTH_SYNC_SCHEDULER_IMPL_H |
OLD | NEW |