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

Unified Diff: tools/dom/src/shared_html.dart

Issue 27240004: Making all callbacks use zones (take 2) (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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
« no previous file with comments | « tools/dom/src/EventStreamProvider.dart ('k') | tools/dom/templates/html/dart2js/html_dart2js.darttemplate » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/src/shared_html.dart
diff --git a/tools/dom/src/shared_html.dart b/tools/dom/src/shared_html.dart
new file mode 100644
index 0000000000000000000000000000000000000000..165e9196c2be9f25b80b2badb07282956d66c550
--- /dev/null
+++ b/tools/dom/src/shared_html.dart
@@ -0,0 +1,14 @@
+// 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.
+
+part of dart.dom.html;
+
+_wrapZone(callback) {
+ // For performance reasons avoid wrapping if we are in the root zone.
+ if (Zone.current == Zone.ROOT) return callback;
+ return Zone.current.bindUnaryCallback(callback, runGuarded: true);
+}
+
+Element query(String selector) => document.query(selector);
+ElementList queryAll(String selector) => document.queryAll(selector);
« no previous file with comments | « tools/dom/src/EventStreamProvider.dart ('k') | tools/dom/templates/html/dart2js/html_dart2js.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698