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

Unified Diff: sdk/lib/_internal/lib/async_patch.dart

Issue 331993005: Rewrite Zone implementation to avoid recursively looking up stuff in the parent chain. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Inadvertent edit. Created 6 years, 6 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 | « runtime/lib/timer_patch.dart ('k') | sdk/lib/async/broadcast_stream_controller.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/lib/async_patch.dart
diff --git a/sdk/lib/_internal/lib/async_patch.dart b/sdk/lib/_internal/lib/async_patch.dart
index cd5890d595fd9ac4e9e875a819b9928c3a2c685b..0203e4dabf2f50192698dbe11615de80fea08ef8 100644
--- a/sdk/lib/_internal/lib/async_patch.dart
+++ b/sdk/lib/_internal/lib/async_patch.dart
@@ -19,21 +19,6 @@ import 'dart:_isolate_helper' show
import 'dart:_foreign_helper' show JS;
@patch
-Timer _createTimer(Duration duration, void callback()) {
- int milliseconds = duration.inMilliseconds;
- if (milliseconds < 0) milliseconds = 0;
- return new TimerImpl(milliseconds, callback);
-}
-
-@patch
-Timer _createPeriodicTimer(Duration duration,
- void callback(Timer timer)) {
- int milliseconds = duration.inMilliseconds;
- if (milliseconds < 0) milliseconds = 0;
- return new TimerImpl.periodic(milliseconds, callback);
-}
-
-@patch
class _AsyncRun {
@patch
static void _scheduleImmediate(void callback()) {
@@ -64,7 +49,7 @@ class _AsyncRun {
}
static void _scheduleImmediateWithTimer(void callback()) {
- _createTimer(Duration.ZERO, callback);
+ Timer._createTimer(Duration.ZERO, callback);
}
}
@@ -76,4 +61,22 @@ class DeferredLibrary {
}
}
+@patch
+class Timer {
+ @patch
+ static Timer _createTimer(Duration duration, void callback()) {
+ int milliseconds = duration.inMilliseconds;
+ if (milliseconds < 0) milliseconds = 0;
+ return new TimerImpl(milliseconds, callback);
+ }
+
+ @patch
+ static Timer _createPeriodicTimer(Duration duration,
+ void callback(Timer timer)) {
+ int milliseconds = duration.inMilliseconds;
+ if (milliseconds < 0) milliseconds = 0;
+ return new TimerImpl.periodic(milliseconds, callback);
+ }
+}
+
bool get _hasDocument => JS('String', 'typeof document') == 'object';
« no previous file with comments | « runtime/lib/timer_patch.dart ('k') | sdk/lib/async/broadcast_stream_controller.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698