OLD | NEW |
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium OS 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 CHROMEOS_PLATFORM_UPDATE_ENGINE_UPDATE_CHECK_SCHEDULER_H__ | 5 #ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_UPDATE_CHECK_SCHEDULER_H__ |
6 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_UPDATE_CHECK_SCHEDULER_H__ | 6 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_UPDATE_CHECK_SCHEDULER_H__ |
7 | 7 |
8 #include <base/basictypes.h> | 8 #include <base/basictypes.h> |
9 #include <glib.h> | 9 #include <glib.h> |
10 #include <gtest/gtest_prod.h> // for FRIEND_TEST | 10 #include <gtest/gtest_prod.h> // for FRIEND_TEST |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 UpdateCheckScheduler(UpdateAttempter* update_attempter); | 43 UpdateCheckScheduler(UpdateAttempter* update_attempter); |
44 virtual ~UpdateCheckScheduler(); | 44 virtual ~UpdateCheckScheduler(); |
45 | 45 |
46 // Initiates the periodic update checks, if necessary. | 46 // Initiates the periodic update checks, if necessary. |
47 void Run(); | 47 void Run(); |
48 | 48 |
49 // Sets the new update status. This is invoked by UpdateAttempter. | 49 // Sets the new update status. This is invoked by UpdateAttempter. |
50 void SetUpdateStatus(UpdateStatus status); | 50 void SetUpdateStatus(UpdateStatus status); |
51 | 51 |
52 void set_poll_interval(int interval) { poll_interval_ = interval; } | 52 void set_poll_interval(int interval) { poll_interval_ = interval; } |
| 53 int poll_interval() const { return poll_interval_; } |
53 | 54 |
54 private: | 55 private: |
55 friend class UpdateCheckSchedulerTest; | 56 friend class UpdateCheckSchedulerTest; |
56 FRIEND_TEST(UpdateCheckSchedulerTest, CanScheduleTest); | 57 FRIEND_TEST(UpdateCheckSchedulerTest, CanScheduleTest); |
57 FRIEND_TEST(UpdateCheckSchedulerTest, ComputeNextIntervalAndFuzzBackoffTest); | 58 FRIEND_TEST(UpdateCheckSchedulerTest, ComputeNextIntervalAndFuzzBackoffTest); |
58 FRIEND_TEST(UpdateCheckSchedulerTest, ComputeNextIntervalAndFuzzPollTest); | 59 FRIEND_TEST(UpdateCheckSchedulerTest, ComputeNextIntervalAndFuzzPollTest); |
59 FRIEND_TEST(UpdateCheckSchedulerTest, ComputeNextIntervalAndFuzzPriorityTest); | 60 FRIEND_TEST(UpdateCheckSchedulerTest, ComputeNextIntervalAndFuzzPriorityTest); |
60 FRIEND_TEST(UpdateCheckSchedulerTest, ComputeNextIntervalAndFuzzTest); | 61 FRIEND_TEST(UpdateCheckSchedulerTest, ComputeNextIntervalAndFuzzTest); |
61 FRIEND_TEST(UpdateCheckSchedulerTest, GTimeoutAddSecondsTest); | 62 FRIEND_TEST(UpdateCheckSchedulerTest, GTimeoutAddSecondsTest); |
62 FRIEND_TEST(UpdateCheckSchedulerTest, IsBootDeviceRemovableTest); | 63 FRIEND_TEST(UpdateCheckSchedulerTest, IsBootDeviceRemovableTest); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 | 120 |
120 // Server dictated poll interval in seconds, if positive. | 121 // Server dictated poll interval in seconds, if positive. |
121 int poll_interval_; | 122 int poll_interval_; |
122 | 123 |
123 DISALLOW_COPY_AND_ASSIGN(UpdateCheckScheduler); | 124 DISALLOW_COPY_AND_ASSIGN(UpdateCheckScheduler); |
124 }; | 125 }; |
125 | 126 |
126 } // namespace chromeos_update_engine | 127 } // namespace chromeos_update_engine |
127 | 128 |
128 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_CHECK_SCHEDULER_H__ | 129 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_CHECK_SCHEDULER_H__ |
OLD | NEW |