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

Side by Side Diff: runtime/bin/vmservice/observatory/deployed/web/packages/template_binding/js/microtask.js

Issue 839543002: Revert "Build Observatory with runtime" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 /*
2 * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
3 * This code may only be used under the BSD style license found at http://polyme r.github.io/LICENSE.txt
4 * The complete set of authors may be found at http://polymer.github.io/AUTHORS. txt
5 * The complete set of contributors may be found at http://polymer.github.io/CON TRIBUTORS.txt
6 * Code distributed by Google as part of the polymer project is also
7 * subject to an additional IP rights grant found at http://polymer.github.io/PA TENTS.txt
8 */
9
10 (function(scope) {
11
12 var iterations = 0;
13 var callbacks = [];
14 var twiddle = document.createTextNode('');
15
16 function endOfMicrotask(callback) {
17 twiddle.textContent = iterations++;
18 callbacks.push(callback);
19 }
20
21 function atEndOfMicrotask() {
22 while (callbacks.length) {
23 callbacks.shift()();
24 }
25 }
26
27 new (window.MutationObserver || JsMutationObserver)(atEndOfMicrotask)
28 .observe(twiddle, {characterData: true})
29 ;
30
31 // exports
32 scope.endOfMicrotask = endOfMicrotask;
33 // bc
34 Platform.endOfMicrotask = endOfMicrotask;
35
36 })(Polymer);
37
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698