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

Unified Diff: tools/dom/templates/html/dart2js/html_dart2js.darttemplate

Issue 27082002: Making all callbacks use zones (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/dartium/html_dartium.darttemplate » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/templates/html/dart2js/html_dart2js.darttemplate
diff --git a/tools/dom/templates/html/dart2js/html_dart2js.darttemplate b/tools/dom/templates/html/dart2js/html_dart2js.darttemplate
index c2868a9504b613f349195ac2d39f5215f2a47752..9bc443a8f4c7d8f71074cf971fd28e2ed02daef2 100644
--- a/tools/dom/templates/html/dart2js/html_dart2js.darttemplate
+++ b/tools/dom/templates/html/dart2js/html_dart2js.darttemplate
@@ -53,7 +53,7 @@ import 'dart:_js_helper' show
makeLeafDispatchRecord;
import 'dart:_interceptors' show
Interceptor, JSExtendableArray, findInterceptorConstructorForType,
- findConstructorForWebComponentType, getNativeInterceptor,
+ findConstructorForWebComponentType, getNativeInterceptor,
setDispatchProperty, findInterceptorForType;
import 'dart:_isolate_helper' show IsolateNatives;
import 'dart:_foreign_helper' show JS;
@@ -147,3 +147,9 @@ int _getNewIsolateId() {
_callPortSync(int id, message) {
return JS('var', r'ReceivePortSync.dispatchCall(#, #)', id, message);
}
+
+_wrapZone(callback) {
Emily Fortuna 2013/10/14 17:30:39 feels a little suboptimal to put the identical cod
blois 2013/10/14 19:48:50 Done.
+ // 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);
+}
« no previous file with comments | « tools/dom/src/EventStreamProvider.dart ('k') | tools/dom/templates/html/dartium/html_dartium.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698