Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Side by Side Diff: ios/web/webui/resources/timer.js

Issue 2744963002: Introduce InterfaceEndpointClient(IEC), InterfaceEndpointHandle and (Closed)
Patch Set: Add binding.html layout test for connection error with reason. Reset IEC when reset() or close()… Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 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.
4
5 // Module "timer"
6 //
7 // This module provides basic createOneShot, createRepeating support. The
8 // reason to define this module is to forward calls to setTimeout, setInterval
9 // exposed by the browser. Mojo JS bindings are currently loaded using gin
10 // and createOneShot, createRepeating is not always available.
yzshen1 2017/03/24 21:20:12 is -> are?
wangjimmy 2017/03/27 16:51:27 Done.
11 //
12 // TODO(crbug.com/703380): When the Mojo JS bindings move away from gin,
13 // this module could be removed.
14
15 define("timer", [], function() {
16 /**
17 * Executes a function once after the set time delay.
18 * @param {int} delay Milliseconds to wait before executing the code.
19 * @callback callback
20 */
21 function createOneShot(delay, callback) {
22 setTimeout(callback, delay);
23 }
24
25 /**
26 * Repeatedly executes a function with a fixed time delay between each call.
27 * @param {int} delay Milliseconds to wait between executions of the code
28 * @callback callback
29 */
30 function createRepeating(delay, callback) {
31 setInterval(callback, delay);
32 }
33
34 var exports = {};
35 exports.createOneShot = createOneShot;
36 exports.createRepeating = createRepeating;
37 return exports;
38 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698