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