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

Unified Diff: ios/web/webui/resources/timer.js

Issue 2744963002: Introduce InterfaceEndpointClient(IEC), InterfaceEndpointHandle and (Closed)
Patch Set: Resolve Merge with new changes from master. 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 side-by-side diff with in-line comments
Download patch
Index: ios/web/webui/resources/timer.js
diff --git a/ios/web/webui/resources/timer.js b/ios/web/webui/resources/timer.js
new file mode 100644
index 0000000000000000000000000000000000000000..41e81fab570a4e88f171670f57a1822ea4892e8b
--- /dev/null
+++ b/ios/web/webui/resources/timer.js
@@ -0,0 +1,30 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Module "timer"
+//
+// This module provides basic setTimeout, setInterval support. The reason to
+// define this module to forward calls to setTimeout, setInterval exposed by
+// the browser. Mojo JS bindings are currently loaded using gin
+// and setTimeout, setInterval is not always available. When the Mojo JS
Eugene But (OOO till 7-30) 2017/03/20 20:53:46 If this is a workaround, could you please add "TOD
wangjimmy 2017/03/21 16:53:37 Done.
+// bindings move away from gin, this module could be removed.
+
+define("timer", [], function() {
+ /**
+ * Logs a message to the console.
Eugene But (OOO till 7-30) 2017/03/20 20:53:46 Please update the comment to reflect what this fun
wangjimmy 2017/03/21 16:53:37 Done.
+ * @param {string} message to log.
+ */
+ function createOneShot(delay, callback) {
+ setTimeout(callback, delay);
+ }
+
+ function createRepeating(delay, callback) {
Eugene But (OOO till 7-30) 2017/03/20 20:53:46 Please add a comment
wangjimmy 2017/03/21 16:53:37 Done.
+ setInterval(callback, delay);
+ }
+
+ var exports = {};
+ exports.createOneShot = createOneShot;
+ exports.createRepeating = createRepeating;
+ return exports;
+});

Powered by Google App Engine
This is Rietveld 408576698