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 // TODO(mpcomplete): We need documentation before we can release this. |
4 | 5 |
5 // TODO(mpcomplete): We need documentation before we can release this. | 6 // Use the <code>chrome.alarms</code> module to schedule code to run |
| 7 // periodically or at a specified time in the future. |
6 | 8 |
7 namespace alarms { | 9 namespace alarms { |
8 dictionary Alarm { | 10 dictionary Alarm { |
9 // Name of this alarm. | 11 // Name of this alarm. |
10 DOMString name; | 12 DOMString name; |
11 | 13 |
12 // Time at which this alarm was scheduled to fire, in milliseconds past the | 14 // Time at which this alarm was scheduled to fire, in milliseconds past the |
13 // epoch (e.g. <code>Date.now() + n</code>). For performance reasons, the | 15 // epoch (e.g. <code>Date.now() + n</code>). For performance reasons, the |
14 // alarm may have been delayed an arbitrary amount beyond this. | 16 // alarm may have been delayed an arbitrary amount beyond this. |
15 double scheduledTime; | 17 double scheduledTime; |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 // Clears all alarms. | 90 // Clears all alarms. |
89 static void clearAll(); | 91 static void clearAll(); |
90 }; | 92 }; |
91 | 93 |
92 interface Events { | 94 interface Events { |
93 // Fired when an alarm has elapsed. Useful for event pages. | 95 // Fired when an alarm has elapsed. Useful for event pages. |
94 // |alarm|: The alarm that has elapsed. | 96 // |alarm|: The alarm that has elapsed. |
95 static void onAlarm(Alarm alarm); | 97 static void onAlarm(Alarm alarm); |
96 }; | 98 }; |
97 }; | 99 }; |
OLD | NEW |