| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_BROWSER_EXTENSIONS_API_ALARMS_ALARM_MANAGER_H__ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_ALARMS_ALARM_MANAGER_H__ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_ALARMS_ALARM_MANAGER_H__ | 6 #define CHROME_BROWSER_EXTENSIONS_API_ALARMS_ALARM_MANAGER_H__ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <queue> | 9 #include <queue> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 static AlarmManager* Get(Profile* profile); | 115 static AlarmManager* Get(Profile* profile); |
| 116 | 116 |
| 117 private: | 117 private: |
| 118 friend void RunScheduleNextPoll(AlarmManager*); | 118 friend void RunScheduleNextPoll(AlarmManager*); |
| 119 friend class ExtensionAlarmsSchedulingTest; | 119 friend class ExtensionAlarmsSchedulingTest; |
| 120 FRIEND_TEST_ALL_PREFIXES(ExtensionAlarmsSchedulingTest, PollScheduling); | 120 FRIEND_TEST_ALL_PREFIXES(ExtensionAlarmsSchedulingTest, PollScheduling); |
| 121 FRIEND_TEST_ALL_PREFIXES(ExtensionAlarmsSchedulingTest, | 121 FRIEND_TEST_ALL_PREFIXES(ExtensionAlarmsSchedulingTest, |
| 122 ReleasedExtensionPollsInfrequently); | 122 ReleasedExtensionPollsInfrequently); |
| 123 FRIEND_TEST_ALL_PREFIXES(ExtensionAlarmsSchedulingTest, TimerRunning); | 123 FRIEND_TEST_ALL_PREFIXES(ExtensionAlarmsSchedulingTest, TimerRunning); |
| 124 FRIEND_TEST_ALL_PREFIXES(ExtensionAlarmsSchedulingTest, MinimumGranularity); | 124 FRIEND_TEST_ALL_PREFIXES(ExtensionAlarmsSchedulingTest, MinimumGranularity); |
| 125 FRIEND_TEST_ALL_PREFIXES(ExtensionAlarmsSchedulingTest, |
| 126 DifferentMinimumGranularities); |
| 125 friend class ProfileKeyedAPIFactory<AlarmManager>; | 127 friend class ProfileKeyedAPIFactory<AlarmManager>; |
| 126 | 128 |
| 127 typedef std::string ExtensionId; | 129 typedef std::string ExtensionId; |
| 128 typedef std::map<ExtensionId, AlarmList> AlarmMap; | 130 typedef std::map<ExtensionId, AlarmList> AlarmMap; |
| 129 | 131 |
| 130 typedef base::Callback<void(const std::string&)> ReadyAction; | 132 typedef base::Callback<void(const std::string&)> ReadyAction; |
| 131 typedef std::queue<ReadyAction> ReadyQueue; | 133 typedef std::queue<ReadyAction> ReadyQueue; |
| 132 typedef std::map<ExtensionId, ReadyQueue> ReadyMap; | 134 typedef std::map<ExtensionId, ReadyQueue> ReadyMap; |
| 133 | 135 |
| 134 // Iterator used to identify a particular alarm within the Map/List pair. | 136 // Iterator used to identify a particular alarm within the Map/List pair. |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 | 226 |
| 225 // Next poll's time. Used only by unit tests. | 227 // Next poll's time. Used only by unit tests. |
| 226 base::Time test_next_poll_time_; | 228 base::Time test_next_poll_time_; |
| 227 | 229 |
| 228 DISALLOW_COPY_AND_ASSIGN(AlarmManager); | 230 DISALLOW_COPY_AND_ASSIGN(AlarmManager); |
| 229 }; | 231 }; |
| 230 | 232 |
| 231 } // namespace extensions | 233 } // namespace extensions |
| 232 | 234 |
| 233 #endif // CHROME_BROWSER_EXTENSIONS_API_ALARMS_ALARM_MANAGER_H__ | 235 #endif // CHROME_BROWSER_EXTENSIONS_API_ALARMS_ALARM_MANAGER_H__ |
| OLD | NEW |