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

Side by Side Diff: Tools/GardeningServer/lib/ct-scheduled-updater.html

Issue 728023004: Remove GardeningServer. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « Tools/GardeningServer/lib/chart-loader.html ('k') | Tools/GardeningServer/lib/net.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!--
2 Copyright 2014 The Chromium Authors. All rights reserved.
3 Use of this source code is governed by a BSD-style license that can be
4 found in the LICENSE file.
5 -->
6
7 <script>
8 // Schedule a repeated action with requestAnimationFrame to avoid doing work
9 // when the tab is hidden.
10 function CTScheduledUpdater(callback, interval) {
11 this.callback = callback;
12 this._isScheduled = false;
13 this._intervalId = setInterval(this._schedule.bind(this), interval);
14 }
15
16 CTScheduledUpdater.prototype._schedule = function() {
17 if (this._isScheduled)
18 return;
19
20 this._isScheduled = true;
21 requestAnimationFrame(this._do.bind(this));
22 }
23
24 CTScheduledUpdater.prototype._do = function() {
25 this._isScheduled = false;
26 this.callback();
27 }
28 </script>
OLDNEW
« no previous file with comments | « Tools/GardeningServer/lib/chart-loader.html ('k') | Tools/GardeningServer/lib/net.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698