cygprofile: increase timeouts to allow showing web contents
[chromium-blink-merge.git] / chrome / browser / resources / cryptotoken / window-timer.js
blob4f99d678967ef07ea09c4248cadca4989ebc2b82
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 /**
6 * @fileoverview Provides an implementation of the SystemTimer interface based
7 * on window's timer methods.
8 */
9 'use strict';
11 /**
12 * Creates an implementation of the SystemTimer interface based on window's
13 * timer methods.
14 * @constructor
15 * @implements {SystemTimer}
17 function WindowTimer() {
20 /**
21 * Sets a single-shot timer.
22 * @param {function()} func Called back when the timer expires.
23 * @param {number} timeoutMillis How long until the timer fires, in
24 * milliseconds.
25 * @return {number} A timeout ID, which can be used to cancel the timer.
27 WindowTimer.prototype.setTimeout = function(func, timeoutMillis) {
28 return window.setTimeout(func, timeoutMillis);
31 /**
32 * Clears a previously set timer.
33 * @param {number} timeoutId The ID of the timer to clear.
35 WindowTimer.prototype.clearTimeout = function(timeoutId) {
36 window.clearTimeout(timeoutId);
39 /**
40 * Sets a repeating interval timer.
41 * @param {function()} func Called back each time the timer fires.
42 * @param {number} timeoutMillis How long until the timer fires, in
43 * milliseconds.
44 * @return {number} A timeout ID, which can be used to cancel the timer.
46 WindowTimer.prototype.setInterval = function(func, timeoutMillis) {
47 return window.setInterval(func, timeoutMillis);
50 /**
51 * Clears a previously set interval timer.
52 * @param {number} timeoutId The ID of the timer to clear.
54 WindowTimer.prototype.clearInterval = function(timeoutId) {
55 window.clearInterval(timeoutId);