| 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 // Use the <code>chrome.alarms</code> API to schedule code to run | 5 // Use the <code>chrome.alarms</code> API to schedule code to run |
| 6 // periodically or at a specified time in the future. | 6 // periodically or at a specified time in the future. |
| 7 namespace alarms { | 7 [use_movable_types=true] 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 |
| 17 // If not null, the alarm is a repeating alarm and will fire again in | 17 // If not null, the alarm is a repeating alarm and will fire again in |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 // Clears all alarms. | 87 // Clears all alarms. |
| 88 static void clearAll(optional ClearCallback callback); | 88 static void clearAll(optional ClearCallback callback); |
| 89 }; | 89 }; |
| 90 | 90 |
| 91 interface Events { | 91 interface Events { |
| 92 // Fired when an alarm has elapsed. Useful for event pages. | 92 // Fired when an alarm has elapsed. Useful for event pages. |
| 93 // |alarm|: The alarm that has elapsed. | 93 // |alarm|: The alarm that has elapsed. |
| 94 static void onAlarm(Alarm alarm); | 94 static void onAlarm(Alarm alarm); |
| 95 }; | 95 }; |
| 96 }; | 96 }; |
| OLD | NEW |