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

Unified Diff: pkg/polymer/lib/platform.dart

Issue 41293002: Fixes from polymer.dart API review (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Made Job a part of polymer Created 7 years, 2 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: pkg/polymer/lib/platform.dart
diff --git a/pkg/polymer/lib/platform.dart b/pkg/polymer/lib/platform.dart
deleted file mode 100644
index ea26eb08a6efe884293d2f94f4377258099bde96..0000000000000000000000000000000000000000
--- a/pkg/polymer/lib/platform.dart
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-/**
- * Exposes helper functionality for interacting with the platform. Similar to
- * the [Platform] class from dart:html.
- */
-// TODO(jmesserly): in Polymer this is a static class called "Platform", but
-// that conflicts with dart:html. What should we do? Does this functionality
-// belong in html's Platform instead?
-library polymer.platform;
-
-import 'dart:async' show Completer;
-import 'dart:html' show Text, MutationObserver;
-import 'dart:collection' show Queue;
-import 'package:observe/observe.dart';
-
-void flush() => endOfMicrotask(Observable.dirtyCheck);
-
-int _iterations = 0;
-final Queue _callbacks = new Queue();
-final Text _twiddle = () {
- var twiddle = new Text('');
- new MutationObserver((x, y) {
- while (_callbacks.isNotEmpty) {
- try {
- _callbacks.removeFirst()();
- } catch (e) { // Dart note: fire the error async.
- new Completer().completeError(e);
- }
- }
- }).observe(twiddle, characterData: true);
- return twiddle;
-}();
-
-void endOfMicrotask(void callback()) {
- _twiddle.text = '${_iterations++}';
- _callbacks.add(callback);
-}

Powered by Google App Engine
This is Rietveld 408576698